kit 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,11 @@
1
1
  = Kit ChangeLog
2
2
 
3
+ == 1.1.0
4
+
5
+ === Breaking changes
6
+
7
+ +KitActionsDefault+ now extends all +Kit::Bit+ instances instead of only those without a group.
8
+
3
9
  == 1.0.0
4
10
 
5
11
  === Breaking changes
@@ -18,5 +24,3 @@ See the skeleton kit for the updated structure.
18
24
  === Enhancements
19
25
 
20
26
  * Added changelog.
21
-
22
- === Bug fixes
data/lib/kit.rb CHANGED
@@ -15,6 +15,7 @@ class Kit
15
15
  def initialize config_file
16
16
  @config_file = File.absolute_path config_file
17
17
  Dir["#{path}/models/*.rb"].each { |f| require f }
18
+ require "#{path}/actions/default"
18
19
  Dir["#{path}/actions/*.rb"].each { |f| require f }
19
20
  end
20
21
 
@@ -68,5 +69,4 @@ class Kit
68
69
  KitDBSupport.send action, config[:db], *args
69
70
  end
70
71
  end
71
-
72
72
  end
@@ -5,9 +5,8 @@ class Kit::Bit < ActiveRecord::Base
5
5
  has_many :users, :through => :permissions
6
6
 
7
7
  after_initialize do
8
- if self.group.nil?
9
- self.extend KitActionsDefault
10
- else
8
+ self.extend KitActionsDefault
9
+ unless self.group.nil?
11
10
  mod = "KitActions#{self.group.name.gsub(' ', '_').camelize}"
12
11
  self.extend Kernel.const_get(mod) if Kernel.const_defined? mod
13
12
  end
data/lib/kit/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  class Kit
2
2
  # Version number.
3
- VERSION = '1.0.1'
4
- end
3
+ VERSION = '1.1.0'
4
+ end
@@ -11,7 +11,7 @@ describe KitDBSupport do
11
11
  describe "create!" do
12
12
 
13
13
  it "raises error if adapter not supported" do
14
- expect { KitDBSupport::create!(:adapter => 'bad_adapter') }.should raise_error RuntimeError, /not supported/
14
+ expect { KitDBSupport::create!(:adapter => 'bad_adapter') }.to raise_error RuntimeError, /not supported/
15
15
  end
16
16
 
17
17
  context "adapter is sqlite3" do
@@ -24,7 +24,7 @@ describe KitDBSupport do
24
24
 
25
25
  it "raises error if sqlite3 database file exists" do
26
26
  File.stub(:exists?).with(@sqlite3[:database]).and_return(true)
27
- expect { KitDBSupport::create! @config[:sqlite3] }.should raise_error RuntimeError, /exists/
27
+ expect { KitDBSupport::create! @config[:sqlite3] }.to raise_error RuntimeError, /exists/
28
28
  end
29
29
  end
30
30
  end
@@ -37,14 +37,14 @@ describe KitDBSupport do
37
37
 
38
38
  it "does not raise error if sqlite3 database file exists" do
39
39
  File.stub(:exists?).with(@sqlite3[:database]).and_return(true)
40
- expect { KitDBSupport::create @config[:sqlite3] }.should_not raise_error RuntimeError, /exists/
40
+ expect { KitDBSupport::create @config[:sqlite3] }.to_not raise_error RuntimeError, /exists/
41
41
  end
42
42
  end
43
43
 
44
44
  describe "destroy!" do
45
45
 
46
46
  it "raises error if adapter not supported" do
47
- expect { KitDBSupport::destroy!(:adapter => 'bad_adapter') }.should raise_error RuntimeError, /not supported/
47
+ expect { KitDBSupport::destroy!(:adapter => 'bad_adapter') }.to raise_error RuntimeError, /not supported/
48
48
  end
49
49
 
50
50
  context "adapter is sqlite3" do
@@ -57,7 +57,7 @@ describe KitDBSupport do
57
57
 
58
58
  it "raises error if sqlite3 database file does not exist" do
59
59
  File.stub(:exists?).with(@sqlite3[:database]).and_return(false)
60
- expect { KitDBSupport::destroy! @config[:sqlite3] }.should raise_error RuntimeError, /does not exist/
60
+ expect { KitDBSupport::destroy! @config[:sqlite3] }.to raise_error RuntimeError, /does not exist/
61
61
  end
62
62
  end
63
63
  end
@@ -70,7 +70,7 @@ describe KitDBSupport do
70
70
 
71
71
  it "does not raise error if sqlite3 database file does not exist" do
72
72
  File.stub(:exists?).with(@sqlite3[:database]).and_return(false)
73
- expect { KitDBSupport::destroy @config[:sqlite3] }.should_not raise_error RuntimeError, /does not exist/
73
+ expect { KitDBSupport::destroy @config[:sqlite3] }.to_not raise_error RuntimeError, /does not exist/
74
74
  end
75
75
  end
76
76
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-13 00:00:00.000000000 Z
12
+ date: 2012-08-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -151,4 +151,3 @@ test_files:
151
151
  - spec/bit_spec.rb
152
152
  - spec/kit_db_support_spec.rb
153
153
  - spec/kit_spec.rb
154
- has_rdoc: