iron_worker 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/iron_worker/config.rb +17 -3
- data/lib/iron_worker/service.rb +3 -2
- metadata +19 -19
data/VERSION.yml
CHANGED
data/lib/iron_worker/config.rb
CHANGED
@@ -62,6 +62,16 @@ module IronWorker
|
|
62
62
|
@gems_to_skip
|
63
63
|
end
|
64
64
|
|
65
|
+
def bundle=(activate)
|
66
|
+
if activate
|
67
|
+
IronWorker.logger.info "Initializing IronWorker for Bundler..."
|
68
|
+
IronWorker.configure do |c2|
|
69
|
+
c2.merged_gems.merge!(get_required_gems)
|
70
|
+
IronWorker.logger.debug "List of gems from bundler:#{c2.merged_gems.inspect}"
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
65
75
|
def auto_merge=(b)
|
66
76
|
if b
|
67
77
|
IronWorker.logger.info "Initializing IronWorker for Rails 3..."
|
@@ -85,7 +95,7 @@ module IronWorker
|
|
85
95
|
if defined?(ActionMailer) && ActionMailer::Base.smtp_settings
|
86
96
|
c2.mailer = ActionMailer::Base.smtp_settings
|
87
97
|
end
|
88
|
-
c2.merged_gems.merge!(get_required_gems)
|
98
|
+
c2.merged_gems.merge!(get_required_gems)
|
89
99
|
IronWorker.logger.debug "MODELS " + c2.models.inspect
|
90
100
|
IronWorker.logger.debug "MAILERS " + c2.mailers.inspect
|
91
101
|
IronWorker.logger.debug "DATABASE " + c2.database.inspect
|
@@ -98,6 +108,8 @@ module IronWorker
|
|
98
108
|
|
99
109
|
|
100
110
|
def get_required_gems
|
111
|
+
#skipping if bundler not defined or not initialized
|
112
|
+
return {} unless defined?(Bundler) && Bundler.instance_variables.include?(:@setup)
|
101
113
|
gems_in_gemfile = Bundler.environment.dependencies.select { |d| d.groups.include?(:default) }
|
102
114
|
IronWorker.logger.debug 'gems in gemfile=' + gems_in_gemfile.inspect
|
103
115
|
gems = {}
|
@@ -114,7 +126,8 @@ module IronWorker
|
|
114
126
|
# next if dep.name=='rails' #monkey patch
|
115
127
|
gem_info = {:name=>spec.name, :version=>spec.version}
|
116
128
|
gem_info[:auto_merged] = true
|
117
|
-
gem_info[:merge] =
|
129
|
+
gem_info[:merge] = spec.extensions.length == 0 #merging only non binary gems
|
130
|
+
gem_info[:bypass_require] = true #don't require gem'
|
118
131
|
# Now find dependency in gemfile in case user set the require
|
119
132
|
dep = gems_in_gemfile.find { |g| g.name == gem_info[:name] }
|
120
133
|
if dep
|
@@ -125,8 +138,9 @@ module IronWorker
|
|
125
138
|
end
|
126
139
|
gem_info[:version] = spec.version.to_s
|
127
140
|
gems[gem_info[:name]] = gem_info
|
128
|
-
path = IronWorker::Service.get_gem_path(gem_info)
|
141
|
+
gemspec,path = IronWorker::Service.get_gem_path(gem_info)
|
129
142
|
if path
|
143
|
+
gem_info[:gemspec] = gemspec
|
130
144
|
gem_info[:path] = path
|
131
145
|
if gem_info[:require].nil? && dep
|
132
146
|
# see if we should try to require this in our worker
|
data/lib/iron_worker/service.rb
CHANGED
@@ -182,12 +182,13 @@ require 'json'
|
|
182
182
|
#require gems dependencies
|
183
183
|
gems_dependencies.each_pair do |k, gem|
|
184
184
|
IronWorker.logger.debug "Bundling gem #{gem[:name]}..."
|
185
|
-
f.write "$LOAD_PATH
|
185
|
+
f.write "$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '/gems/#{gem[:name]}/lib'))\n"
|
186
186
|
end
|
187
187
|
# require merged gems
|
188
188
|
merged_gems.each_pair do |k, gem|
|
189
189
|
IronWorker.logger.debug "Bundling gem #{gem[:name]}..."
|
190
|
-
f.write "$LOAD_PATH
|
190
|
+
f.write "$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '/gems/#{gem[:name]}/lib'))\n"
|
191
|
+
next if gem[:bypass_require]
|
191
192
|
IronWorker.logger.debug 'writing requires: ' + gem[:require].inspect
|
192
193
|
if gem[:require].nil?
|
193
194
|
gem[:require] = []
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iron_worker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: zip
|
16
|
-
requirement: &
|
16
|
+
requirement: &17798880 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *17798880
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rest-client
|
27
|
-
requirement: &
|
27
|
+
requirement: &17798160 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *17798160
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rest
|
38
|
-
requirement: &
|
38
|
+
requirement: &17797560 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *17797560
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
|
-
requirement: &
|
49
|
+
requirement: &17797060 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *17797060
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: zip
|
60
|
-
requirement: &
|
60
|
+
requirement: &17796420 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *17796420
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rest-client
|
71
|
-
requirement: &
|
71
|
+
requirement: &17795820 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *17795820
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: rest
|
82
|
-
requirement: &
|
82
|
+
requirement: &17795320 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *17795320
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: bundler
|
93
|
-
requirement: &
|
93
|
+
requirement: &17794460 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :runtime
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *17794460
|
102
102
|
description: The official IronWorker gem for IronWorker by Iron.io. http://www.iron.io
|
103
103
|
email: travis@iron.io
|
104
104
|
executables: []
|
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
143
|
rubyforge_project:
|
144
|
-
rubygems_version: 1.8.
|
144
|
+
rubygems_version: 1.8.15
|
145
145
|
signing_key:
|
146
146
|
specification_version: 3
|
147
147
|
summary: The official IronWorker gem for IronWorker by Iron.io. http://www.iron.io
|