Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

make it work with 1.9.2

  • Loading branch information...
commit c31ac79a5c598967584d90b9e7b27fbf441dc04e 1 parent 02be006
@gnandretta gnandretta authored committed
View
2  lib/palette/cli.rb
@@ -4,7 +4,7 @@ class Cli
def initialize(*args)
if File.exist?(path = File.expand_path(args.first))
begin
- puts Palette::Dsl.run lambda {
+ puts Palette::Dsl.run {
eval(IO.read(path), binding, path)
}
rescue
View
2  lib/palette/dsl.rb
@@ -1,6 +1,6 @@
module Palette
class Dsl
- def self.run(block)
+ def self.run(&block)
new.instance_eval(&block)
end
View
16 spec/color_scheme_spec.rb
@@ -89,14 +89,14 @@
before { Palette::Rule.stubs(:new => "Custom rule") }
it "creates simple rules" do
- Palette::ColorScheme.run "one", lambda {
+ Palette::ColorScheme.run "one", proc {
Comment "ABCDEF", :gui => "bold"
}
Palette::Rule.should have_received(:new).with("Comment", "ABCDEF", :gui => "bold")
end
it "creates multiple rules" do
- Palette::ColorScheme.run "one", lambda {
+ Palette::ColorScheme.run "one", proc {
Comment "ABCDEF", :gui => "bold"
Regexp :gui => "bold"
}
@@ -105,14 +105,14 @@
end
it "handles Ruby naming conflicts" do
- Palette::ColorScheme.run "one", lambda {
+ Palette::ColorScheme.run "one", proc {
String "ABCDEF"
}
Palette::Rule.should have_received(:new).with("String", "ABCDEF")
end
it "outputs rules" do
- output = Palette::ColorScheme.run "one", lambda {
+ output = Palette::ColorScheme.run "one", proc {
Comment "ABCDEF", :gui => "bold"
String "ABCDEF"
}
@@ -125,14 +125,14 @@
before { Palette::Link.stubs(:new => "Custom link") }
it "handles simple linking" do
- Palette::ColorScheme.run "one", lambda {
+ Palette::ColorScheme.run "one", proc {
link :Something, :to => :Another
}
Palette::Link.should have_received(:new).with(:Something, :Another)
end
it "handles complex linking" do
- Palette::ColorScheme.run "one", lambda {
+ Palette::ColorScheme.run "one", proc {
link :Something, :Else, :to => :Another
link :Red, :to => :Black
}
@@ -142,7 +142,7 @@
end
it "outputs links" do
- output = Palette::ColorScheme.run "one", lambda {
+ output = Palette::ColorScheme.run "one", proc {
link :Something, :Else, :to => :Another
link :Red, :to => :Black
}
@@ -182,7 +182,7 @@
end
it "creates a new color scheme with the correct name" do
- Palette::ColorScheme.run "Great", lambda {
+ Palette::ColorScheme.run "Great", proc {
great
}
Palette::ColorScheme.should have_received(:new).with("Great")
View
4 spec/dsl_spec.rb
@@ -11,9 +11,9 @@
it "runs schemes" do
Palette::ColorScheme.stubs(:run)
- Palette::Dsl.run lambda {
+ Palette::Dsl.run do
vim_colors("awesome") {}
- }
+ end
Palette::ColorScheme.should have_received(:run)
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.