Skip to content

Instantly share code, notes, and snippets.

# Hack to avoid "allocator undefined for Proc" issue when unpacking Gems:
# gemspec provided by Jeweler uses Rake::FileList for files, test_files and
# extra_rdoc_files, and procs cannot be marshalled.
# Jeweler Issue GH-73
# Workaround by Alex Coles (myabc)
def gemspec
@clean_gemspec ||= eval("#{Rake.application.jeweler.gemspec.to_ruby}") # $SAFE = 3\n
end
import hudson.Launcher;
import hudson.Extension;
import hudson.util.FormValidation;
import hudson.model.AbstractBuild;
import hudson.model.BuildListener;
import hudson.model.AbstractProject;
import hudson.tasks.Builder;
import hudson.tasks.BuildStepDescriptor;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.DataBoundConstructor;
# Sets the repository URL based on the given repository.
# Valid uses:
# * uses_repository :github => 'me/my-plugin'
# * uses_repository :github => 'my-plugin' -- Implies hosting under the
# jenkinsci organization.
# * uses_repository :git => 'https://code.google.com/p/my-plugin'
# * uses_repository :svn => 'https://svn.jenkins-ci.org/trunk/hudson/plugins/my-plugin'
def uses_repository(opts)
#impl
end
@cowboyd
cowboyd / hacks.rb
Created November 15, 2011 21:26 — forked from metaskills/hacks.rb
Failed ImportProcessor
module Less
module Rails
class ImportProcessor < Tilt::Template
IMPORT_SCANNER = /@import\s*['"]([^'"]+)['"]\s*;/.freeze
def prepare
end
def evaluate(context, locals, &block)
require 'jenkins/plugin/behavior'
module Jenkins
#
# Defines the equivalent of `hudson.Extension`
#
module Extension
extend Plugin::Behavior
module ClassMethods
require 'rubygems'
require 'v8'
def print_resources
rss = /\w*[ ]*#{Process.pid}[ ]*([.,\d]*)[ ]*([.,\d]*)[ ]*([\d]*)[ ]*([\d]*)/.match(`ps aux`)[4]
print "resources: #{rss.to_i/1024}MB\n"
end
print_resources
import Ember from 'ember';
export default Ember.Component.extend({
didRender() {
console.log('didRender');
console.log('pojo1', this.get('pojo1'));
console.log('pojo2', this.get('pojo2'));
console.log('pojo3', this.get('pojo3'));
}
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
setText(text) {
this.attrs.updateMessageAtIndexPath(message, indexPath);
}
}
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
setText(text) {
console.log('text=', text);
this.attrs.updateMessageAtIndexPath(message, indexPath);
}
+----------+
| | error(e)
+------| Error |<-------------------+-------------------------+
| | | | |
| +----------+ | |
| ^ | |
| | | |
| | | |
| |error(e) | |
| | | |