dalliance 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dalliance/railtie.rb +13 -0
- data/lib/dalliance/version.rb +1 -1
- data/lib/dalliance.rb +44 -14
- data/spec/support/active_record.rb +3 -0
- metadata +18 -17
data/lib/dalliance/version.rb
CHANGED
data/lib/dalliance.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'dalliance/version'
|
2
|
+
require 'dalliance/railtie'
|
2
3
|
|
3
4
|
require 'dalliance/progress_meter'
|
4
5
|
|
@@ -130,22 +131,51 @@ module Dalliance
|
|
130
131
|
1
|
131
132
|
end
|
132
133
|
end
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
class ActiveRecord::Base
|
137
|
-
def self.dalliance(*args)
|
138
|
-
options = args.last.is_a?(Hash) ? Dalliance.options.merge(args.pop) : Dalliance.options
|
134
|
+
|
135
|
+
module Glue
|
136
|
+
extend ActiveSupport::Concern
|
139
137
|
|
140
|
-
|
141
|
-
|
142
|
-
options[:dalliance_method] = args[0]
|
143
|
-
else
|
144
|
-
raise ArgumentError, "Incorrect number of Arguements provided"
|
138
|
+
included do
|
139
|
+
class_attribute :dalliance_options if respond_to?(:class_attribute)
|
145
140
|
end
|
146
141
|
|
147
|
-
|
148
|
-
|
149
|
-
|
142
|
+
module ClassMethods
|
143
|
+
def dalliance(*args)
|
144
|
+
options = args.last.is_a?(Hash) ? Dalliance.options.merge(args.pop) : Dalliance.options
|
145
|
+
|
146
|
+
case args.length
|
147
|
+
when 1
|
148
|
+
options[:dalliance_method] = args[0]
|
149
|
+
else
|
150
|
+
raise ArgumentError, "Incorrect number of Arguements provided"
|
151
|
+
end
|
152
|
+
|
153
|
+
if dalliance_options.nil?
|
154
|
+
if respond_to?(:class_attribute)
|
155
|
+
self.dalliance_options = {}
|
156
|
+
else
|
157
|
+
write_inheritable_attribute(:dalliance_options, {})
|
158
|
+
end
|
159
|
+
else
|
160
|
+
if respond_to?(:class_attribute)
|
161
|
+
self.dalliance_options = self.dalliance_options.dup
|
162
|
+
else
|
163
|
+
write_inheritable_attribute(:dalliance_options, self.dalliance_options.dup)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
self.dalliance_options.merge!(options)
|
168
|
+
|
169
|
+
include Dalliance
|
170
|
+
end
|
171
|
+
|
172
|
+
def dalliance_options
|
173
|
+
if respond_to?(:class_attribute)
|
174
|
+
self.dalliance_options
|
175
|
+
else
|
176
|
+
read_inheritable_attribute(:dalliance_options)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
150
180
|
end
|
151
181
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dalliance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
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-
|
12
|
+
date: 2012-03-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
16
|
-
requirement: &
|
16
|
+
requirement: &70192797957220 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.0.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70192797957220
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activesupport
|
27
|
-
requirement: &
|
27
|
+
requirement: &70192797956080 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 3.0.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70192797956080
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: delayed_job
|
38
|
-
requirement: &
|
38
|
+
requirement: &70192797954180 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 2.0.0
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70192797954180
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: state_machine
|
49
|
-
requirement: &
|
49
|
+
requirement: &70192797953760 !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: *70192797953760
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rspec
|
60
|
-
requirement: &
|
60
|
+
requirement: &70192797953260 !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: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70192797953260
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: delayed_job_active_record
|
71
|
-
requirement: &
|
71
|
+
requirement: &70192797952420 !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: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70192797952420
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: sqlite3
|
82
|
-
requirement: &
|
82
|
+
requirement: &70192797951660 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70192797951660
|
91
91
|
description: ! ' Opinionated background processing for ActiveRecord w/ delayed_job
|
92
92
|
& state_machine '
|
93
93
|
email:
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- dalliance.gemspec
|
106
106
|
- lib/dalliance.rb
|
107
107
|
- lib/dalliance/progress_meter.rb
|
108
|
+
- lib/dalliance/railtie.rb
|
108
109
|
- lib/dalliance/version.rb
|
109
110
|
- lib/generators/dalliance/progress_meter/progress_meter_generator.rb
|
110
111
|
- lib/generators/dalliance/progress_meter/templates/migration.rb
|
@@ -138,7 +139,7 @@ rubyforge_project: dalliance
|
|
138
139
|
rubygems_version: 1.8.10
|
139
140
|
signing_key:
|
140
141
|
specification_version: 3
|
141
|
-
summary: dalliance 0.0.
|
142
|
+
summary: dalliance 0.0.3
|
142
143
|
test_files:
|
143
144
|
- spec/dalliance/asynchronous_spec.rb
|
144
145
|
- spec/dalliance/dalliance_spec.rb
|