jacaranda 0.0.1 → 0.0.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.
- checksums.yaml +7 -0
- data/.travis.yml +4 -0
- data/README.md +2 -66
- data/jacaranda.gemspec +4 -0
- data/lib/jacaranda.rb +1 -0
- data/lib/jacaranda/version.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- metadata +45 -26
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2052db476d84751d6b8c221ff265721a70fea299
|
4
|
+
data.tar.gz: 5dd74b11a9b70194ed638b991955bbb632922925
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: da6b6896a2be3b373eed5608d3655cb15bac5166c79b262862cbf89ca9f134d92d31ef0a9caa14776b264ff5be31a8c3c3e0b275d17d1bad3bb91cfbda66c4dd
|
7
|
+
data.tar.gz: 3ccfd6d82d8249509acaeeb83693a58e2f8c58b46100bfc3140d40b1041c3df72bc28a18718c24b18aaeec7c1d2a509e0f678b9ba898d6b47c2baf2bac56a9d4
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,70 +1,6 @@
|
|
1
1
|
# Jacaranda
|
2
2
|
|
3
|
-
|
3
|
+
Jacaranda is deprecated since we have the ActiveRecord::Enum in rails >= 4.0.1.
|
4
4
|
|
5
|
-
|
5
|
+
[More info here](http://groselhas.maurogeorge.com.br/good-bye-jacaranda-and-welcome-activerecord-enum.html).
|
6
6
|
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
gem 'jacaranda'
|
10
|
-
|
11
|
-
And then execute:
|
12
|
-
|
13
|
-
$ bundle
|
14
|
-
|
15
|
-
Or install it yourself as:
|
16
|
-
|
17
|
-
$ gem install jacaranda
|
18
|
-
|
19
|
-
## Usage
|
20
|
-
|
21
|
-
### Basic
|
22
|
-
|
23
|
-
Simply add the following line **after the validations**:
|
24
|
-
|
25
|
-
acts_as_jacaranda
|
26
|
-
|
27
|
-
like that
|
28
|
-
|
29
|
-
class Post < ActiveRecord::Base
|
30
|
-
validates :status, inclusion: { in: %w{published unpublished draft} }
|
31
|
-
acts_as_jacaranda
|
32
|
-
end
|
33
|
-
|
34
|
-
Now your model Post received some powers, we see them.
|
35
|
-
|
36
|
-
#### Predicate methods
|
37
|
-
|
38
|
-
Ask `@post` if it was published with `@post.published?` or it is a draft with `@post.draft?`.
|
39
|
-
|
40
|
-
#### Scopes
|
41
|
-
|
42
|
-
Find the posts based on column `status` using the generated scopes like `Post.published` e `Post.draft`.
|
43
|
-
|
44
|
-
### Scoped
|
45
|
-
|
46
|
-
Perhaps model has 2 validations of inclusion that have valid values repeated
|
47
|
-
|
48
|
-
class Post < ActiveRecord::Base
|
49
|
-
validates :status, inclusion: { in: %w{published unpublished draft} }
|
50
|
-
validates :kind, inclusion: { in: %w{report unpublished draft} }
|
51
|
-
acts_as_jacaranda
|
52
|
-
end
|
53
|
-
|
54
|
-
in this case use Jacaranda with the param `scoped`:
|
55
|
-
|
56
|
-
acts_as_jacaranda scoped: true
|
57
|
-
|
58
|
-
which will generate methods based on column like `#unpublished_status?` and `#unpublished_kind?`.
|
59
|
-
|
60
|
-
## Versioning
|
61
|
-
|
62
|
-
Jacaranda follow the [Semantic Versioning](http://semver.org/).
|
63
|
-
|
64
|
-
## Contributing
|
65
|
-
|
66
|
-
1. Fork it
|
67
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
68
|
-
3. Commit your changes (`git commit -am 'Added some feature'`)
|
69
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
70
|
-
5. Create new Pull Request
|
data/jacaranda.gemspec
CHANGED
@@ -18,6 +18,10 @@ Gem::Specification.new do |gem|
|
|
18
18
|
|
19
19
|
gem.add_dependency "activerecord", ">= 3.0.0"
|
20
20
|
|
21
|
+
gem.post_install_message = 'Jacaranda is deprecated. More info at http://groselhas.maurogeorge.com.br/good-bye-jacaranda-and-welcome-activerecord-enum.html'
|
22
|
+
|
23
|
+
gem.add_development_dependency "rake"
|
24
|
+
gem.add_development_dependency "coveralls"
|
21
25
|
gem.add_development_dependency "sqlite3"
|
22
26
|
gem.add_development_dependency "rspec"
|
23
27
|
gem.add_development_dependency "pry-meta"
|
data/lib/jacaranda.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "active_record"
|
2
2
|
|
3
3
|
I18n.load_path << File.join(File.dirname(__FILE__), "config", "locales", "en.yml")
|
4
|
+
warn '[deprecated] Jacaranda is deprecated. More info at http://groselhas.maurogeorge.com.br/good-bye-jacaranda-and-welcome-activerecord-enum.html'
|
4
5
|
|
5
6
|
module Jacaranda
|
6
7
|
require "jacaranda/version"
|
data/lib/jacaranda/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,78 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jacaranda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Mauro George
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-12-29 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: activerecord
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 3.0.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 3.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: coveralls
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
30
55
|
- !ruby/object:Gem::Dependency
|
31
56
|
name: sqlite3
|
32
57
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
58
|
requirements:
|
35
|
-
- -
|
59
|
+
- - '>='
|
36
60
|
- !ruby/object:Gem::Version
|
37
61
|
version: '0'
|
38
62
|
type: :development
|
39
63
|
prerelease: false
|
40
64
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
65
|
requirements:
|
43
|
-
- -
|
66
|
+
- - '>='
|
44
67
|
- !ruby/object:Gem::Version
|
45
68
|
version: '0'
|
46
69
|
- !ruby/object:Gem::Dependency
|
47
70
|
name: rspec
|
48
71
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
72
|
requirements:
|
51
|
-
- -
|
73
|
+
- - '>='
|
52
74
|
- !ruby/object:Gem::Version
|
53
75
|
version: '0'
|
54
76
|
type: :development
|
55
77
|
prerelease: false
|
56
78
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
79
|
requirements:
|
59
|
-
- -
|
80
|
+
- - '>='
|
60
81
|
- !ruby/object:Gem::Version
|
61
82
|
version: '0'
|
62
83
|
- !ruby/object:Gem::Dependency
|
63
84
|
name: pry-meta
|
64
85
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
86
|
requirements:
|
67
|
-
- -
|
87
|
+
- - '>='
|
68
88
|
- !ruby/object:Gem::Version
|
69
89
|
version: '0'
|
70
90
|
type: :development
|
71
91
|
prerelease: false
|
72
92
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
93
|
requirements:
|
75
|
-
- -
|
94
|
+
- - '>='
|
76
95
|
- !ruby/object:Gem::Version
|
77
96
|
version: '0'
|
78
97
|
description: jacaranda generates helper methods based on your model validations.
|
@@ -83,6 +102,7 @@ extensions: []
|
|
83
102
|
extra_rdoc_files: []
|
84
103
|
files:
|
85
104
|
- .gitignore
|
105
|
+
- .travis.yml
|
86
106
|
- Gemfile
|
87
107
|
- LICENSE
|
88
108
|
- README.md
|
@@ -101,27 +121,26 @@ files:
|
|
101
121
|
- spec/support/schema.rb
|
102
122
|
homepage: https://github.com/maurogeorge/jacaranda
|
103
123
|
licenses: []
|
104
|
-
|
124
|
+
metadata: {}
|
125
|
+
post_install_message: Jacaranda is deprecated. More info at http://groselhas.maurogeorge.com.br/good-bye-jacaranda-and-welcome-activerecord-enum.html
|
105
126
|
rdoc_options: []
|
106
127
|
require_paths:
|
107
128
|
- lib
|
108
129
|
required_ruby_version: !ruby/object:Gem::Requirement
|
109
|
-
none: false
|
110
130
|
requirements:
|
111
|
-
- -
|
131
|
+
- - '>='
|
112
132
|
- !ruby/object:Gem::Version
|
113
133
|
version: '0'
|
114
134
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
-
none: false
|
116
135
|
requirements:
|
117
|
-
- -
|
136
|
+
- - '>='
|
118
137
|
- !ruby/object:Gem::Version
|
119
138
|
version: '0'
|
120
139
|
requirements: []
|
121
140
|
rubyforge_project:
|
122
|
-
rubygems_version:
|
141
|
+
rubygems_version: 2.0.5
|
123
142
|
signing_key:
|
124
|
-
specification_version:
|
143
|
+
specification_version: 4
|
125
144
|
summary: jacaranda generates helper methods based on your model validations - creating
|
126
145
|
common methods and scopes.
|
127
146
|
test_files:
|