rails-sh 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc CHANGED
@@ -47,8 +47,6 @@ please type help
47
47
 
48
48
  == TODO
49
49
 
50
- * parse args of rake commands and set values as ENV
51
-
52
50
  == Contributing to rails-sh
53
51
 
54
52
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.2
1
+ 1.2.3
data/bin/rails-sh CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ version = 'v' + File.read(File.expand_path('../../VERSION', __FILE__))
3
4
  puts <<BANNER.gsub("%", "\e[46m \e[0m")
4
5
 
5
6
  .%%%%%....%%%%...%%%%%%..%%.......%%%%............%%%%...%%..%%.
@@ -8,6 +9,7 @@ puts <<BANNER.gsub("%", "\e[46m \e[0m")
8
9
  .%%..%%..%%..%%....%%....%%..........%%..............%%..%%..%%.
9
10
  .%%..%%..%%..%%..%%%%%%..%%%%%%...%%%%............%%%%...%%..%%.
10
11
  ................................................................
12
+ \e[35m#{version.rjust(63, " ")}\e[0m
11
13
 
12
14
  BANNER
13
15
 
data/lib/rails/sh/rake.rb CHANGED
@@ -15,8 +15,17 @@ module Rails
15
15
  $stdout = STDOUT
16
16
  end
17
17
 
18
- def invoke(name)
19
- Process.waitpid(fork { ::Rake.application[name].invoke })
18
+ def invoke(line)
19
+ name, *args = line.split(/\s+/)
20
+ pid = fork do
21
+ args.each do |arg|
22
+ env, value = arg.split('=')
23
+ next unless env && !env.empty? && value && !value.empty?
24
+ ENV[env] = value
25
+ end
26
+ ::Rake.application[name].invoke
27
+ end
28
+ Process.waitpid(pid)
20
29
  end
21
30
 
22
31
  def task_names
data/rails-sh.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rails-sh}
8
- s.version = "1.2.2"
8
+ s.version = "1.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["jugyo"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rails-sh
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.2.2
5
+ version: 1.2.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - jugyo
@@ -99,7 +99,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
- hash: 1781657170898971860
102
+ hash: 2133100381079114914
103
103
  segments:
104
104
  - 0
105
105
  version: "0"