active_hash 0.9.2 → 0.9.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/CHANGELOG CHANGED
@@ -1,5 +1,8 @@
1
+ 2011-04-19
2
+ - better dependency management and compatibility with ActiveSupport 2.x (thanks vandrijevik!)
3
+
1
4
  2011-01-22
2
- - improved method_missing errors for dynamic finders (
5
+ - improved method_missing errors for dynamic finders
3
6
  - prevent users from trying to overwrite :attributes (https://github.com/zilkey/active_hash/issues/#issue/33)
4
7
 
5
8
  2010-12-08
data/Gemfile CHANGED
@@ -1,8 +1,10 @@
1
1
  source :gemcutter
2
2
 
3
- gem "activerecord", "3.0.3"
4
- gem "activesupport", "3.0.3"
5
- gem "fixjour", "0.5.3"
6
- gem "rspec", "2.2.0"
7
- gem "sqlite3-ruby", ">= 1.3.2"
8
- gem 'rake'
3
+ gemspec
4
+
5
+ group :development do
6
+ gem "activerecord"
7
+ gem "rake"
8
+ gem "rspec", "2.2.0"
9
+ gem "sqlite3-ruby", ">= 1.3.2"
10
+ end
data/active_hash.gemspec CHANGED
@@ -22,7 +22,8 @@ Gem::Specification.new do |s|
22
22
  "Ryan Garver",
23
23
  "Tom Stuart",
24
24
  "Joel Chippindale",
25
- "Kevin Olsen"
25
+ "Kevin Olsen",
26
+ "Vladimir Andrijevik"
26
27
  ]
27
28
  s.date = %q{2011-01-22}
28
29
  s.email = %q{jeff@zilkey.com}
@@ -43,7 +44,6 @@ Gem::Specification.new do |s|
43
44
  s.summary = %q{An ActiveRecord-like model that uses a hash or file as a datasource}
44
45
  s.test_files = [
45
46
  "Gemfile",
46
- "Gemfile.lock",
47
47
  "spec/active_file/base_spec.rb",
48
48
  "spec/active_hash/base_spec.rb",
49
49
  "spec/active_yaml/base_spec.rb",
data/lib/active_hash.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'active_support'
2
2
 
3
3
  begin
4
- require 'active_support/all'
4
+ require 'active_support/core_ext'
5
5
  rescue MissingSourceFile
6
6
  end
7
7
 
@@ -88,8 +88,9 @@ module ActiveHash
88
88
 
89
89
  def transaction
90
90
  yield
91
+ rescue LocalJumpError => err
92
+ raise err
91
93
  rescue ActiveRecord::Rollback
92
-
93
94
  end
94
95
 
95
96
  def delete_all
@@ -1,5 +1,5 @@
1
1
  module ActiveHash
2
2
  module Gem
3
- VERSION = "0.9.2"
3
+ VERSION = "0.9.3"
4
4
  end
5
5
  end
data/lib/enum/enum.rb CHANGED
@@ -43,7 +43,7 @@ module ActiveHash
43
43
  private :set_constant
44
44
 
45
45
  def constant_for(field_value)
46
- if constant = field_value.try(:dup)
46
+ if constant = !field_value.nil? && field_value.dup
47
47
  constant.gsub!(/\W+/, "_")
48
48
  constant.gsub!(/^_|_$/, '')
49
49
  constant.upcase!
@@ -11,6 +11,15 @@ describe ActiveHash, "Base" do
11
11
  Object.send :remove_const, :Country
12
12
  end
13
13
 
14
+ it "passes LocalJumpError through in .transaction when no block is given" do
15
+ expect { Country.transaction }.to raise_error(LocalJumpError)
16
+ end
17
+
18
+ # This require must be after the above example so that ActiveRecord
19
+ # is available in its full glory for the test classes that use it,
20
+ # but doesn't create a false positive for the above example.
21
+ require "active_record"
22
+
14
23
  describe ".fields" do
15
24
  before do
16
25
  Country.fields :name, :iso_name
@@ -944,34 +953,4 @@ describe ActiveHash, "Base" do
944
953
 
945
954
  end
946
955
 
947
- describe "using with Fixjour" do
948
-
949
- before do
950
- Country.field :name
951
- Fixjour :allow_redundancy => true do
952
- define_builder(Country) do |klass, overrides|
953
- klass.new(:name => 'Pat')
954
- end
955
- end
956
- end
957
-
958
- it "should verify" do
959
- Fixjour.verify!
960
- end
961
-
962
- it "should work with the create builder" do
963
- proc do
964
- create_country
965
- end.should change(Country, :count).by(1)
966
- end
967
-
968
- it "should work with the new builder" do
969
- proc do
970
- country = new_country :name => "foo"
971
- country.name.should == "foo"
972
- end.should_not change(Country, :count)
973
- end
974
-
975
- end
976
-
977
956
  end
data/spec/spec_helper.rb CHANGED
@@ -1,12 +1,6 @@
1
1
  require 'rspec'
2
2
  require 'rspec/autorun'
3
- require 'active_record'
4
- require 'fixjour'
5
3
 
6
4
  $LOAD_PATH.unshift(File.dirname(__FILE__))
7
5
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
8
6
  require 'active_hash'
9
-
10
- RSpec.configure do |config|
11
- config.include Fixjour
12
- end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_hash
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 61
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 2
10
- version: 0.9.2
9
+ - 3
10
+ version: 0.9.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeff Dean
@@ -24,6 +24,7 @@ authors:
24
24
  - Tom Stuart
25
25
  - Joel Chippindale
26
26
  - Kevin Olsen
27
+ - Vladimir Andrijevik
27
28
  autorequire:
28
29
  bindir: bin
29
30
  cert_chain: []
@@ -69,7 +70,6 @@ files:
69
70
  - lib/associations/associations.rb
70
71
  - lib/enum/enum.rb
71
72
  - Gemfile
72
- - Gemfile.lock
73
73
  - spec/active_file/base_spec.rb
74
74
  - spec/active_hash/base_spec.rb
75
75
  - spec/active_yaml/base_spec.rb
@@ -107,13 +107,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  requirements: []
108
108
 
109
109
  rubyforge_project:
110
- rubygems_version: 1.4.2
110
+ rubygems_version: 1.6.2
111
111
  signing_key:
112
112
  specification_version: 3
113
113
  summary: An ActiveRecord-like model that uses a hash or file as a datasource
114
114
  test_files:
115
115
  - Gemfile
116
- - Gemfile.lock
117
116
  - spec/active_file/base_spec.rb
118
117
  - spec/active_hash/base_spec.rb
119
118
  - spec/active_yaml/base_spec.rb
data/Gemfile.lock DELETED
@@ -1,41 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- activemodel (3.0.3)
5
- activesupport (= 3.0.3)
6
- builder (~> 2.1.2)
7
- i18n (~> 0.4)
8
- activerecord (3.0.3)
9
- activemodel (= 3.0.3)
10
- activesupport (= 3.0.3)
11
- arel (~> 2.0.2)
12
- tzinfo (~> 0.3.23)
13
- activesupport (3.0.3)
14
- arel (2.0.6)
15
- builder (2.1.2)
16
- diff-lcs (1.1.2)
17
- fixjour (0.5.3)
18
- activerecord
19
- i18n (0.5.0)
20
- rake (0.8.7)
21
- rspec (2.2.0)
22
- rspec-core (~> 2.2)
23
- rspec-expectations (~> 2.2)
24
- rspec-mocks (~> 2.2)
25
- rspec-core (2.2.1)
26
- rspec-expectations (2.2.0)
27
- diff-lcs (~> 1.1.2)
28
- rspec-mocks (2.2.0)
29
- sqlite3-ruby (1.3.2)
30
- tzinfo (0.3.23)
31
-
32
- PLATFORMS
33
- ruby
34
-
35
- DEPENDENCIES
36
- activerecord (= 3.0.3)
37
- activesupport (= 3.0.3)
38
- fixjour (= 0.5.3)
39
- rake
40
- rspec (= 2.2.0)
41
- sqlite3-ruby (>= 1.3.2)