bounce 0.1.0 → 0.1.2
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/README.md +0 -1
- data/lib/bounce.rb +24 -2
- data/lib/bounce/version.rb +1 -1
- metadata +42 -70
- data/lib/bounce/extension.rb +0 -13
- data/lib/bounce/railtie.rb +0 -15
- data/test/fixtures/bounce.sqlite3 +0 -0
data/README.md
CHANGED
data/lib/bounce.rb
CHANGED
@@ -1,3 +1,25 @@
|
|
1
1
|
require 'rails'
|
2
|
-
|
3
|
-
|
2
|
+
|
3
|
+
module Bounce
|
4
|
+
module ActiveRecordExtension
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
def bounce(params=nil)
|
8
|
+
tap { |o| params.present? ? o.update_attributes(params) : o.save }
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class Railtie < Rails::Railtie
|
13
|
+
initializer 'bounce.initialize' do
|
14
|
+
ActiveSupport.on_load(:active_record) do
|
15
|
+
Bounce::Railtie.insert
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class Railtie
|
21
|
+
def self.insert
|
22
|
+
ActiveRecord::Base.send :include, Bounce::ActiveRecordExtension
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/bounce/version.rb
CHANGED
metadata
CHANGED
@@ -1,106 +1,78 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: bounce
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
- 0
|
10
|
-
version: 0.1.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.2
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- John Thomas Marino
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-09-29 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: sqlite3-ruby
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70252877618340 !ruby/object:Gem::Requirement
|
25
17
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
version: "0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
33
22
|
type: :development
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: activerecord
|
37
23
|
prerelease: false
|
38
|
-
|
24
|
+
version_requirements: *70252877618340
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: activerecord
|
27
|
+
requirement: &70252877617840 !ruby/object:Gem::Requirement
|
39
28
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
44
|
-
segments:
|
45
|
-
- 3
|
46
|
-
- 0
|
47
|
-
version: "3.0"
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3.0'
|
48
33
|
type: :runtime
|
49
|
-
|
50
|
-
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70252877617840
|
36
|
+
description: ! "\n\n `bounce` will save and return an active record object. This
|
37
|
+
results in a nice refactor of update and create actions in your controllers when
|
38
|
+
used with `respond_with`.\n "
|
51
39
|
email: writejm@gmail.com
|
52
40
|
executables: []
|
53
|
-
|
54
41
|
extensions: []
|
55
|
-
|
56
42
|
extra_rdoc_files: []
|
57
|
-
|
58
|
-
files:
|
43
|
+
files:
|
59
44
|
- README.md
|
60
45
|
- Rakefile
|
61
46
|
- LICENSE
|
62
|
-
- lib/bounce/extension.rb
|
63
|
-
- lib/bounce/railtie.rb
|
64
47
|
- lib/bounce/version.rb
|
65
48
|
- lib/bounce.rb
|
66
49
|
- test/bounce_test.rb
|
67
50
|
- test/fixtures/article.rb
|
68
|
-
- test/fixtures/bounce.sqlite3
|
69
51
|
- test/fixtures/schema.rb
|
70
52
|
- test/helper.rb
|
71
|
-
|
72
|
-
homepage: http://github.com/johmas/bounce
|
53
|
+
homepage: http://github.com/johnnytommy/bounce
|
73
54
|
licenses: []
|
74
|
-
|
75
55
|
post_install_message:
|
76
56
|
rdoc_options: []
|
77
|
-
|
78
|
-
require_paths:
|
57
|
+
require_paths:
|
79
58
|
- lib
|
80
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
81
60
|
none: false
|
82
|
-
requirements:
|
83
|
-
- -
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
|
86
|
-
|
87
|
-
- 0
|
88
|
-
version: "0"
|
89
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ! '>='
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
66
|
none: false
|
91
|
-
requirements:
|
92
|
-
- -
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
|
95
|
-
segments:
|
96
|
-
- 0
|
97
|
-
version: "0"
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
98
71
|
requirements: []
|
99
|
-
|
100
72
|
rubyforge_project: bounce
|
101
|
-
rubygems_version: 1.
|
73
|
+
rubygems_version: 1.8.6
|
102
74
|
signing_key:
|
103
75
|
specification_version: 3
|
104
|
-
summary: bounce is a rails method that saves and returns an active record object.
|
76
|
+
summary: bounce is a rails method that saves and returns an active record object.
|
77
|
+
If you like skinny controllers, you'll love bounce.
|
105
78
|
test_files: []
|
106
|
-
|
data/lib/bounce/extension.rb
DELETED
data/lib/bounce/railtie.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
module Bounce
|
2
|
-
class Railtie < Rails::Railtie
|
3
|
-
initializer 'bounce.initialize' do
|
4
|
-
ActiveSupport.on_load(:active_record) do
|
5
|
-
Bounce::Railtie.insert
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
class Railtie
|
11
|
-
def self.insert
|
12
|
-
ActiveRecord::Base.send :include, Bounce::ActiveRecordExtension
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
Binary file
|