Skip to content

Commit

Permalink
Ruby 1.9 compat: remove instance variables and global variables from …
Browse files Browse the repository at this point in the history
…block parameters

[#1000 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
amatsuda authored and jeremy committed Sep 9, 2008
1 parent 8e68ec4 commit 5f7c424
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions railties/lib/commands/plugin.rb
Expand Up @@ -461,11 +461,11 @@ def options

o.on("-r", "--root=DIR", String,
"Set an explicit rails app directory.",
"Default: #{@rails_root}") { |@rails_root| self.environment = RailsEnvironment.new(@rails_root) }
"Default: #{@rails_root}") { |rails_root| @rails_root = rails_root; self.environment = RailsEnvironment.new(@rails_root) }
o.on("-s", "--source=URL1,URL2", Array,
"Use the specified plugin repositories instead of the defaults.") { |@sources|}
"Use the specified plugin repositories instead of the defaults.") { |sources| @sources = sources}

o.on("-v", "--verbose", "Turn on verbose output.") { |$verbose| }
o.on("-v", "--verbose", "Turn on verbose output.") { |verbose| $verbose = verbose }
o.on("-h", "--help", "Show this help message.") { puts o; exit }

o.separator ""
Expand Down Expand Up @@ -552,12 +552,12 @@ def options
o.separator "Options:"
o.separator ""
o.on( "-s", "--source=URL1,URL2", Array,
"Use the specified plugin repositories.") {|@sources|}
"Use the specified plugin repositories.") {|sources| @sources = sources}
o.on( "--local",
"List locally installed plugins.") {|@local| @remote = false}
"List locally installed plugins.") {|local| @local, @remote = local, false}
o.on( "--remote",
"List remotely available plugins. This is the default behavior",
"unless --local is provided.") {|@remote|}
"unless --local is provided.") {|remote| @remote = remote}
end
end

Expand Down Expand Up @@ -598,7 +598,7 @@ def options
o.separator "Options:"
o.separator ""
o.on( "-c", "--check",
"Report status of repository.") { |@sources|}
"Report status of repository.") { |sources| @sources = sources}
end
end

Expand Down Expand Up @@ -689,7 +689,7 @@ def options
o.separator "Options:"
o.separator ""
o.on( "-l", "--list",
"List but don't prompt or add discovered repositories.") { |@list| @prompt = !@list }
"List but don't prompt or add discovered repositories.") { |list| @list, @prompt = list, !@list }
o.on( "-n", "--no-prompt",
"Add all new repositories without prompting.") { |v| @prompt = !v }
end
Expand Down

0 comments on commit 5f7c424

Please sign in to comment.