This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
import os | |
class DetectFileTypeCommand(sublime_plugin.EventListener): | |
""" Detects current file type if the file's extension isn't conclusive """ | |
""" Modified for Ruby on Rails and Sublime Text 2 """ | |
""" Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """ | |
def on_load(self, view): | |
filename = view.file_name() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Original with inline Groovier version | |
*/ | |
//def publisher = null | |
//for (iter in project.getPublishersList()) { | |
// if (iter.getDescriptor().getDisplayName().equals("Editable Email Notification")) { | |
// publisher = iter | |
// break | |
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org xsd/maven-.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>mygroup</groupId> | |
<artifactId>Test_Maven_03</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
<name>Test_Maven_03</name> | |
<url>http://maven.apache.org</url> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
customer = { | |
:name => 'Dan Kubb', | |
:orders => [ | |
{ | |
:reference => 'TEST1234', | |
:order_lines => [ | |
{ | |
:item => { | |
:sku => 'BLUEWIDGET1', | |
:unit_price => 1.00, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe Foo do | |
it { should respond_to(:bar) } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rspec --drb spec/models/foo_spec.rb .../rubies/jruby-1.6.7/lib/ruby/1.9/drb/drb.rb:375 warning: | |
ObjectSpace is disabled; _id2ref only supports immediates, pass -X+O to enable | |
NoMethodError: undefined method `flush' for nil:NilClass | |
method_missing at .../rubies/jruby-1.6.7/lib/ruby/1.9/drb/drb.rb:1099 | |
run at .../gems/jruby-1.6.7@cowbania/gems/rspec-core-2.11.1/lib/rspec/core/drb_command_line.rb:22 | |
run at .../gems/jruby-1.6.7@cowbania/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:63 | |
autorun at .../gems/jruby-1.6.7@cowbania/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main; | |
public class Triples { | |
private int number; | |
public Triples() { | |
// Does nothing. | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Reverb::Actions::WatchListing | |
def self.watch(user, product, listener) | |
if product.owner?(user) | |
listener.failure(I18n.t('flash.watchlist.error_own')) | |
else | |
user.user_watch_products.create(:product_id => product.id) | |
listener.success | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean equals(Object obj) { | |
if (this == obj) { | |
return true; | |
} | |
// Consider isAssignableFrom depending on actual needs. | |
if (getClass() != obj.getClass()) { | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BrandAction extends AbstractProductListAction { | |
private static final long serialVersionUID = 3647582541701870610L; | |
protected CatalogBrowsingFacade catalogBrowsingFacade; | |
protected RedirectHandler redirectHandler; | |
private static final String BRAND_CONSTANT="BRAND"; | |
private FormatStrategy formatStrategy; | |
@Override | |
public String execute() { | |
if (searchModel.getFreeTextCount() == 2) { |