stratify-base 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +29 -28
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/lib/stratify/activity.rb +1 -1
- data/lib/stratify/archiver.rb +5 -5
- data/lib/stratify/collector.rb +7 -7
- data/lib/stratify/collector_coordinator.rb +1 -1
- data/lib/stratify/logger.rb +2 -2
- data/lib/stratify/mongoid_extension.rb +1 -1
- data/lib/stratify/renderable.rb +3 -3
- data/lib/stratify/version.rb +1 -1
- data/spec/prototypes/bacon.rb +11 -11
- data/spec/spec_helper.rb +2 -2
- data/spec/stratify/activity_spec.rb +5 -5
- data/spec/stratify/archiver_spec.rb +7 -7
- data/spec/stratify/collector_coordinator_spec.rb +7 -7
- data/spec/stratify/collector_spec.rb +8 -8
- data/spec/stratify/integration_spec.rb +3 -3
- data/spec/stratify/mongoid_extension_spec.rb +2 -2
- data/spec/stratify/renderable_spec.rb +2 -2
- data/stratify-base.gemspec +6 -5
- metadata +29 -18
data/Gemfile.lock
CHANGED
@@ -1,52 +1,53 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
stratify-base (0.1.
|
5
|
-
bson_ext (~> 1.
|
6
|
-
mongoid (~> 2.0
|
4
|
+
stratify-base (0.1.4)
|
5
|
+
bson_ext (~> 1.6.0)
|
6
|
+
mongoid (~> 2.4.0)
|
7
7
|
tilt (~> 1.3.2)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: http://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activemodel (3.
|
13
|
-
activesupport (= 3.
|
14
|
-
bcrypt-ruby (~> 3.0.0)
|
12
|
+
activemodel (3.2.3)
|
13
|
+
activesupport (= 3.2.3)
|
15
14
|
builder (~> 3.0.0)
|
15
|
+
activesupport (3.2.3)
|
16
16
|
i18n (~> 0.6)
|
17
|
-
activesupport (3.1.0)
|
18
17
|
multi_json (~> 1.0)
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
bson (1.6.2)
|
19
|
+
bson_ext (1.6.2)
|
20
|
+
bson (~> 1.6.2)
|
22
21
|
builder (3.0.0)
|
23
|
-
database_cleaner (0.
|
24
|
-
diff-lcs (1.1.
|
22
|
+
database_cleaner (0.7.2)
|
23
|
+
diff-lcs (1.1.3)
|
25
24
|
i18n (0.6.0)
|
26
25
|
mocha (0.9.12)
|
27
|
-
mongo (1.
|
28
|
-
bson (
|
29
|
-
mongoid (2.
|
30
|
-
activemodel (~> 3.
|
26
|
+
mongo (1.6.2)
|
27
|
+
bson (~> 1.6.2)
|
28
|
+
mongoid (2.4.9)
|
29
|
+
activemodel (~> 3.1)
|
31
30
|
mongo (~> 1.3)
|
32
31
|
tzinfo (~> 0.3.22)
|
33
|
-
multi_json (1.
|
34
|
-
|
35
|
-
|
36
|
-
rspec-
|
37
|
-
rspec-
|
38
|
-
|
39
|
-
rspec-
|
40
|
-
|
41
|
-
|
32
|
+
multi_json (1.3.2)
|
33
|
+
rake (0.9.2.2)
|
34
|
+
rspec (2.9.0)
|
35
|
+
rspec-core (~> 2.9.0)
|
36
|
+
rspec-expectations (~> 2.9.0)
|
37
|
+
rspec-mocks (~> 2.9.0)
|
38
|
+
rspec-core (2.9.0)
|
39
|
+
rspec-expectations (2.9.1)
|
40
|
+
diff-lcs (~> 1.1.3)
|
41
|
+
rspec-mocks (2.9.0)
|
42
42
|
tilt (1.3.3)
|
43
|
-
tzinfo (0.3.
|
43
|
+
tzinfo (0.3.33)
|
44
44
|
|
45
45
|
PLATFORMS
|
46
46
|
ruby
|
47
47
|
|
48
48
|
DEPENDENCIES
|
49
|
-
database_cleaner (~> 0.
|
49
|
+
database_cleaner (~> 0.7.2)
|
50
50
|
mocha (~> 0.9.12)
|
51
|
-
|
51
|
+
rake (~> 0.9.2)
|
52
|
+
rspec (~> 2.9.0)
|
52
53
|
stratify-base!
|
data/LICENSE
CHANGED
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
17
17
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
18
18
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
19
19
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
20
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
data/Rakefile
CHANGED
data/lib/stratify/activity.rb
CHANGED
data/lib/stratify/archiver.rb
CHANGED
@@ -3,7 +3,7 @@ require 'stratify/logger'
|
|
3
3
|
module Stratify
|
4
4
|
class Archiver
|
5
5
|
attr_reader :collector
|
6
|
-
|
6
|
+
|
7
7
|
def initialize(collector)
|
8
8
|
@collector = collector
|
9
9
|
end
|
@@ -28,18 +28,18 @@ module Stratify
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def persist_activity(activity)
|
31
|
-
# Since we run the collectors frequently, it is very common to encounter
|
31
|
+
# Since we run the collectors frequently, it is very common to encounter
|
32
32
|
# objects that we have already imported. If this activity is a duplicate
|
33
33
|
# of an existing object, then we skip importing this activity.
|
34
|
-
return if activity.duplicate?
|
34
|
+
return if activity.duplicate?
|
35
35
|
|
36
36
|
unless activity.save
|
37
37
|
Stratify.logger.error("Failed to persist activity: #{activity}.\nValidation errors: #{activity.errors}")
|
38
38
|
end
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
def record_collection_statistics
|
42
42
|
collector.update_attribute :last_ran_at, Time.now
|
43
43
|
end
|
44
44
|
end
|
45
|
-
end
|
45
|
+
end
|
data/lib/stratify/collector.rb
CHANGED
@@ -7,7 +7,7 @@ module Stratify
|
|
7
7
|
include Mongoid::Document
|
8
8
|
|
9
9
|
store_in :collectors
|
10
|
-
|
10
|
+
|
11
11
|
field :last_ran_at, :type => DateTime
|
12
12
|
|
13
13
|
def self.configuration_fields(fields_hash = nil)
|
@@ -32,7 +32,7 @@ module Stratify
|
|
32
32
|
return nil if configuration_fields.empty?
|
33
33
|
read_attribute(configuration_fields.first.name)
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
def run
|
37
37
|
Archiver.new(self).run
|
38
38
|
end
|
@@ -62,14 +62,14 @@ module Stratify
|
|
62
62
|
class << self
|
63
63
|
attr_reader :collector_classes
|
64
64
|
end
|
65
|
-
|
65
|
+
|
66
66
|
@collector_classes = []
|
67
|
-
|
67
|
+
|
68
68
|
def self.inherited(subclass)
|
69
69
|
super
|
70
70
|
Collector.collector_classes << subclass
|
71
71
|
end
|
72
|
-
|
72
|
+
|
73
73
|
def self.collector_class_for(source)
|
74
74
|
Collector.collector_classes.find {|clazz| clazz.source == source}
|
75
75
|
end
|
@@ -86,10 +86,10 @@ module Stratify
|
|
86
86
|
fields_hash.map do |f|
|
87
87
|
name = f[0]
|
88
88
|
attributes = f[1]
|
89
|
-
Stratify::FieldDefinition.new(name, attributes)
|
89
|
+
Stratify::FieldDefinition.new(name, attributes)
|
90
90
|
end
|
91
91
|
end
|
92
|
-
|
92
|
+
|
93
93
|
def self.apply_fields_to_class(field_definitions)
|
94
94
|
field_definitions.each do |field|
|
95
95
|
field field.name
|
data/lib/stratify/logger.rb
CHANGED
data/lib/stratify/renderable.rb
CHANGED
@@ -21,17 +21,17 @@ module Stratify
|
|
21
21
|
:erb
|
22
22
|
end
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def to_html
|
26
26
|
template_handler = Tilt[self.class.template_format].new { self.class.template.strip }
|
27
27
|
template_handler.render(presenter)
|
28
28
|
end
|
29
29
|
|
30
30
|
# Returns the object that will be passed to the template for rendering.
|
31
|
-
#
|
31
|
+
#
|
32
32
|
# The default implementation returns 'self' (i.e., the renderable object).
|
33
33
|
#
|
34
|
-
# Subclasses may optionally override this method to provide an object
|
34
|
+
# Subclasses may optionally override this method to provide an object
|
35
35
|
# better suited for use in rendering (e.g., an object implementing the
|
36
36
|
# presenter pattern).
|
37
37
|
def presenter
|
data/lib/stratify/version.rb
CHANGED
data/spec/prototypes/bacon.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# This file defines an example Stratify collector and activity for testing
|
2
|
-
# purposes.
|
3
|
-
#
|
4
|
-
# Stratify::Bacon::Activity and Stratify::Bacon::Collector represent a
|
5
|
-
# (fictitious, unfortunately) service for tracking your bacon-related
|
6
|
-
# achievements. This also happens to be an *amazing* idea for a service.
|
2
|
+
# purposes.
|
3
|
+
#
|
4
|
+
# Stratify::Bacon::Activity and Stratify::Bacon::Collector represent a
|
5
|
+
# (fictitious, unfortunately) service for tracking your bacon-related
|
6
|
+
# achievements. This also happens to be an *amazing* idea for a service.
|
7
7
|
# You know you want to track your bacon-related achievements. You just know it.
|
8
8
|
|
9
|
-
# Stratify::Bacon::Activity implements all *mandatory* functionality required
|
9
|
+
# Stratify::Bacon::Activity implements all *mandatory* functionality required
|
10
10
|
# for it to be a valid activity.
|
11
11
|
module Stratify
|
12
12
|
module Bacon
|
@@ -20,7 +20,7 @@ module Stratify
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
# Stratify::Bacon::Collector implements all *mandatory* functionality required
|
23
|
+
# Stratify::Bacon::Collector implements all *mandatory* functionality required
|
24
24
|
# for it to be a valid collector.
|
25
25
|
module Stratify
|
26
26
|
module Bacon
|
@@ -30,9 +30,9 @@ module Stratify
|
|
30
30
|
configuration_fields :username => {:type => :string},
|
31
31
|
:password => {:type => :password}
|
32
32
|
|
33
|
-
# Return a fixed set of Stratify::Bacon::Activity objects. (A real
|
34
|
-
# collector would tend to return new data as time goes by. For testing
|
35
|
-
# purposes, it's convenient to have a fixed set of data returned by the
|
33
|
+
# Return a fixed set of Stratify::Bacon::Activity objects. (A real
|
34
|
+
# collector would tend to return new data as time goes by. For testing
|
35
|
+
# purposes, it's convenient to have a fixed set of data returned by the
|
36
36
|
# collector.)
|
37
37
|
def activities
|
38
38
|
[
|
@@ -43,4 +43,4 @@ module Stratify
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
46
|
-
end
|
46
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -26,7 +26,7 @@ RSpec.configure do |config|
|
|
26
26
|
DatabaseCleaner.orm = "mongoid"
|
27
27
|
config.before(:each, :database => true) do
|
28
28
|
DatabaseCleaner.clean
|
29
|
-
end
|
29
|
+
end
|
30
30
|
|
31
31
|
config.before(:suite) do
|
32
32
|
silence_mongoid_logging
|
@@ -45,4 +45,4 @@ end
|
|
45
45
|
def initialize_mongoid_configuration
|
46
46
|
mongoid_config = YAML::load_file(File.join(File.dirname(__FILE__), "mongoid.yml"))
|
47
47
|
Mongoid.from_hash(mongoid_config)
|
48
|
-
end
|
48
|
+
end
|
@@ -13,23 +13,23 @@ describe Stratify::Activity do
|
|
13
13
|
activity.created_on.should be_nil
|
14
14
|
end
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
describe "#delete", :database => true do
|
18
18
|
it "soft-deletes the activity" do
|
19
19
|
creation_time = Time.now
|
20
20
|
activity = Stratify::Bacon::Activity.create!(:slices => 42, :created_at => creation_time)
|
21
21
|
activity.delete
|
22
|
-
|
22
|
+
|
23
23
|
Stratify::Bacon::Activity.where(:slices => 42, :created_at => creation_time).should_not exist
|
24
24
|
Stratify::Bacon::Activity.deleted.where(:slices => 42, :created_at => creation_time).should exist
|
25
25
|
end
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
describe "#duplicate?", :database => true do
|
29
29
|
class ActivityForTestingDuplicates < Stratify::Activity
|
30
30
|
field :foo
|
31
31
|
field :bar
|
32
|
-
|
32
|
+
|
33
33
|
natural_key :foo, :bar
|
34
34
|
end
|
35
35
|
|
@@ -47,7 +47,7 @@ describe Stratify::Activity do
|
|
47
47
|
original = ActivityForTestingDuplicates.new(:foo => "a", :bar => "b", :created_at => Time.now)
|
48
48
|
original.save!
|
49
49
|
original.delete
|
50
|
-
|
50
|
+
|
51
51
|
ActivityForTestingDuplicates.new(:foo => "a", :bar => "b").should be_duplicate
|
52
52
|
end
|
53
53
|
end
|
@@ -19,7 +19,7 @@ describe Stratify::Archiver do
|
|
19
19
|
context "when an exception occurs during collection" do
|
20
20
|
it "propagates the exception to the caller" do
|
21
21
|
archiver = Stratify::Archiver.new(collector = stub)
|
22
|
-
archiver.stubs(:collect_activities).raises("some gnarly error")
|
22
|
+
archiver.stubs(:collect_activities).raises("some gnarly error")
|
23
23
|
lambda { archiver.run }.should raise_error
|
24
24
|
end
|
25
25
|
|
@@ -29,13 +29,13 @@ describe Stratify::Archiver do
|
|
29
29
|
|
30
30
|
collector = Stratify::Collector.create
|
31
31
|
archiver = Stratify::Archiver.new(collector)
|
32
|
-
archiver.stubs(:collect_activities).raises("some gnarly error")
|
32
|
+
archiver.stubs(:collect_activities).raises("some gnarly error")
|
33
33
|
archiver.run rescue nil
|
34
34
|
collector.last_ran_at.should == stub_current_timestamp
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
describe ".collect_activities" do
|
40
40
|
it "documents the source of each activity" do
|
41
41
|
example_collector_class = Class.new(Stratify::Collector)
|
@@ -44,18 +44,18 @@ describe Stratify::Archiver do
|
|
44
44
|
|
45
45
|
activity = Stratify::Activity.new
|
46
46
|
collector.stubs(:activities).returns [activity]
|
47
|
-
|
47
|
+
|
48
48
|
archiver = Stratify::Archiver.new(collector)
|
49
49
|
archiver.stubs(:persist_activity)
|
50
50
|
archiver.send(:collect_activities)
|
51
51
|
activity.source.should == "some-example-source"
|
52
52
|
end
|
53
|
-
|
53
|
+
|
54
54
|
it "persists each activity" do
|
55
55
|
collector = Stratify::Collector.new
|
56
56
|
activity = Stratify::Activity.new
|
57
57
|
collector.stubs(:activities).returns [activity]
|
58
|
-
|
58
|
+
|
59
59
|
archiver = Stratify::Archiver.new(collector)
|
60
60
|
archiver.expects(:persist_activity).with(activity)
|
61
61
|
archiver.send(:collect_activities)
|
@@ -82,4 +82,4 @@ describe Stratify::Archiver do
|
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
|
-
end
|
85
|
+
end
|
@@ -6,28 +6,28 @@ describe Stratify::CollectorCoordinator do
|
|
6
6
|
it "runs all collectors" do
|
7
7
|
collector_1 = mock(:run)
|
8
8
|
collector_2 = mock(:run)
|
9
|
-
|
9
|
+
|
10
10
|
Stratify::Collector.stubs(:all).returns([collector_1, collector_2])
|
11
11
|
|
12
12
|
Stratify::CollectorCoordinator.run_all
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
context "when an exception occurs in a collector" do
|
16
16
|
it "logs the exception" do
|
17
17
|
collector = stub
|
18
|
-
collector.stubs(:run).raises("some gnarly error")
|
18
|
+
collector.stubs(:run).raises("some gnarly error")
|
19
19
|
Stratify::Collector.stubs(:all).returns([collector])
|
20
|
-
|
20
|
+
|
21
21
|
Stratify.logger.expects(:error).with() { |value| value.include? "some gnarly error" }
|
22
22
|
Stratify::CollectorCoordinator.run_all
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
it "runs the remaining collectors" do
|
26
26
|
silence_stratify_logging # Silence the logger so as not to clutter the test output
|
27
27
|
|
28
28
|
troublesome_collector = stub
|
29
|
-
troublesome_collector.stubs(:run).raises("some gnarly error")
|
30
|
-
|
29
|
+
troublesome_collector.stubs(:run).raises("some gnarly error")
|
30
|
+
|
31
31
|
other_collector = mock
|
32
32
|
other_collector.expects(:run).returns(nil)
|
33
33
|
|
@@ -25,13 +25,13 @@ describe Stratify::Collector do
|
|
25
25
|
|
26
26
|
describe ".sources" do
|
27
27
|
before { Stratify::Collector.collector_classes.clear }
|
28
|
-
|
28
|
+
|
29
29
|
it "returns the list of sources for all collectors" do
|
30
30
|
anonymous_collector_subclass.source("FourSquare")
|
31
31
|
anonymous_collector_subclass.source("Twitter")
|
32
32
|
Stratify::Collector.sources.should =~ ["FourSquare", "Twitter"]
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
it "returns the sources in case-insensitive alphabetical order" do
|
36
36
|
anonymous_collector_subclass.source("Twitter")
|
37
37
|
anonymous_collector_subclass.source("iTunes")
|
@@ -47,18 +47,18 @@ describe Stratify::Collector do
|
|
47
47
|
fields.find {|f| f.name == :username && f.type == :string}.should be
|
48
48
|
fields.find {|f| f.name == :password && f.type == :password}.should be
|
49
49
|
end
|
50
|
-
|
50
|
+
|
51
51
|
it "registers the given fields with Mongoid" do
|
52
52
|
TestCollector.fields.should include("username", "password")
|
53
53
|
end
|
54
|
-
|
54
|
+
|
55
55
|
describe "influences validation" do
|
56
56
|
it "adds an error when a collector instance fails to provide a value for each field" do
|
57
57
|
collector = TestCollector.new
|
58
58
|
collector.should_not be_valid
|
59
59
|
collector.errors[:username].should include("can't be blank")
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
it "adds NO errors when a collector instance provides a value for each field" do
|
63
63
|
collector = TestCollector.new(:username => "foo")
|
64
64
|
collector.valid?
|
@@ -78,7 +78,7 @@ describe Stratify::Collector do
|
|
78
78
|
anonymous_collector_subclass.configuration_instructions.should == nil
|
79
79
|
end
|
80
80
|
end
|
81
|
-
|
81
|
+
|
82
82
|
describe "#configuration_instructions (instance method)" do
|
83
83
|
it "returns the configuration instructions defined in the class" do
|
84
84
|
collector_subclass = anonymous_collector_subclass
|
@@ -87,7 +87,7 @@ describe Stratify::Collector do
|
|
87
87
|
collector.configuration_instructions.should == "Provide your username and ..."
|
88
88
|
end
|
89
89
|
end
|
90
|
-
|
90
|
+
|
91
91
|
describe "#configuration_summary" do
|
92
92
|
context "when the collector's class has one configuration field" do
|
93
93
|
it "returns the value of the field" do
|
@@ -121,5 +121,5 @@ describe Stratify::Collector do
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
end
|
124
|
-
|
124
|
+
|
125
125
|
end
|
@@ -10,13 +10,13 @@ describe "collecting activities", :database => true do
|
|
10
10
|
Stratify::Bacon::Activity.where(:slices => 5, :created_at => Time.new(2011, 4, 7, 8, 17)).should exist
|
11
11
|
Stratify::Bacon::Activity.where(:slices => 4, :created_at => Time.new(2011, 4, 9, 6, 24)).should exist
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
it "does not import duplicate activities" do
|
15
15
|
collector = Stratify::Bacon::Collector.new(:username => "johndoe", :password => "secret")
|
16
16
|
expect { collector.run }.to change(Stratify::Bacon::Activity, :count).by(3)
|
17
17
|
expect { collector.run }.to change(Stratify::Bacon::Activity, :count).by(0)
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
it "does not re-import soft-deleted activities" do
|
21
21
|
collector = Stratify::Bacon::Collector.new(:username => "johndoe", :password => "secret")
|
22
22
|
|
@@ -24,7 +24,7 @@ describe "collecting activities", :database => true do
|
|
24
24
|
activity = Stratify::Bacon::Activity.where(:created_at => Time.new(2011, 4, 3, 7, 2)).first
|
25
25
|
activity.should be
|
26
26
|
activity.delete
|
27
|
-
|
27
|
+
|
28
28
|
collector.run
|
29
29
|
Stratify::Bacon::Activity.where(:created_at => Time.new(2011, 4, 3, 7, 2)).should_not exist
|
30
30
|
end
|
@@ -27,7 +27,7 @@ describe Stratify::MongoidExtension::NaturalKey do
|
|
27
27
|
klass.natural_key_fields.should == [:url, :created_at]
|
28
28
|
end
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
it "declares a uniqueness validator for the natural key" do
|
32
32
|
klass = class_with_natural_key_mixin
|
33
33
|
klass.expects(:validates_uniqueness_of_natural_key)
|
@@ -63,7 +63,7 @@ describe Stratify::MongoidExtension::NaturalKey do
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
66
|
-
|
66
|
+
|
67
67
|
describe "#natural_key_hash" do
|
68
68
|
it "returns the field name and value for the object's natural key" do
|
69
69
|
klass = class_with_natural_key_mixin do |k|
|
@@ -27,7 +27,7 @@ describe Stratify::Renderable do
|
|
27
27
|
renderable_class.template_format.should == :haml
|
28
28
|
end
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
describe "#presenter" do
|
32
32
|
it "returns the object" do
|
33
33
|
renderable_object = anonymous_class_with_renderable_mixin.new
|
@@ -46,7 +46,7 @@ describe Stratify::Renderable do
|
|
46
46
|
"Kilgore"
|
47
47
|
end
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
renderable_object.to_html.should == "Hello, Kilgore"
|
51
51
|
end
|
52
52
|
end
|
data/stratify-base.gemspec
CHANGED
@@ -19,11 +19,12 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
|
-
s.add_runtime_dependency "bson_ext", "~> 1.
|
23
|
-
s.add_runtime_dependency "mongoid", "~> 2.0
|
22
|
+
s.add_runtime_dependency "bson_ext", "~> 1.6.0"
|
23
|
+
s.add_runtime_dependency "mongoid", "~> 2.4.0"
|
24
24
|
s.add_runtime_dependency "tilt", "~> 1.3.2"
|
25
|
-
|
26
|
-
s.add_development_dependency "
|
25
|
+
|
26
|
+
s.add_development_dependency "rake", "~> 0.9.2"
|
27
|
+
s.add_development_dependency "rspec", "~> 2.9.0"
|
27
28
|
s.add_development_dependency "mocha", "~> 0.9.12"
|
28
|
-
s.add_development_dependency "database_cleaner", "~> 0.
|
29
|
+
s.add_development_dependency "database_cleaner", "~> 0.7.2"
|
29
30
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stratify-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,33 +9,33 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-04-29 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bson_ext
|
16
|
-
requirement: &
|
16
|
+
requirement: &70298565382900 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
21
|
+
version: 1.6.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70298565382900
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: mongoid
|
27
|
-
requirement: &
|
27
|
+
requirement: &70298565382260 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 2.0
|
32
|
+
version: 2.4.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70298565382260
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: tilt
|
38
|
-
requirement: &
|
38
|
+
requirement: &70298565381760 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,21 +43,32 @@ dependencies:
|
|
43
43
|
version: 1.3.2
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70298565381760
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rake
|
49
|
+
requirement: &70298565381240 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.9.2
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70298565381240
|
47
58
|
- !ruby/object:Gem::Dependency
|
48
59
|
name: rspec
|
49
|
-
requirement: &
|
60
|
+
requirement: &70298565380760 !ruby/object:Gem::Requirement
|
50
61
|
none: false
|
51
62
|
requirements:
|
52
63
|
- - ~>
|
53
64
|
- !ruby/object:Gem::Version
|
54
|
-
version: 2.
|
65
|
+
version: 2.9.0
|
55
66
|
type: :development
|
56
67
|
prerelease: false
|
57
|
-
version_requirements: *
|
68
|
+
version_requirements: *70298565380760
|
58
69
|
- !ruby/object:Gem::Dependency
|
59
70
|
name: mocha
|
60
|
-
requirement: &
|
71
|
+
requirement: &70298565380280 !ruby/object:Gem::Requirement
|
61
72
|
none: false
|
62
73
|
requirements:
|
63
74
|
- - ~>
|
@@ -65,18 +76,18 @@ dependencies:
|
|
65
76
|
version: 0.9.12
|
66
77
|
type: :development
|
67
78
|
prerelease: false
|
68
|
-
version_requirements: *
|
79
|
+
version_requirements: *70298565380280
|
69
80
|
- !ruby/object:Gem::Dependency
|
70
81
|
name: database_cleaner
|
71
|
-
requirement: &
|
82
|
+
requirement: &70298565379820 !ruby/object:Gem::Requirement
|
72
83
|
none: false
|
73
84
|
requirements:
|
74
85
|
- - ~>
|
75
86
|
- !ruby/object:Gem::Version
|
76
|
-
version: 0.
|
87
|
+
version: 0.7.2
|
77
88
|
type: :development
|
78
89
|
prerelease: false
|
79
|
-
version_requirements: *
|
90
|
+
version_requirements: *70298565379820
|
80
91
|
description: Provides the infrastructure to support the development and use of Stratify
|
81
92
|
collectors and activities
|
82
93
|
email:
|