potassium 1.0.1 → 1.1.0
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 +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +8 -8
- data/lib/potassium/templates/application/recipes/asks/lang.rb +8 -0
- data/lib/potassium/templates/application/recipes/devise.rb +1 -0
- data/lib/potassium/templates/application/recipes/i18n.rb +8 -1
- data/lib/potassium/templates/application/template.rb +1 -0
- data/lib/potassium/version.rb +1 -1
- data/potassium.gemspec +5 -5
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44f4877e46ff82660a1c6be6f8f4f7afe69c702d
|
4
|
+
data.tar.gz: 5f2202a4a00fb64e25a77bf8dd0bb71f9998273d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61fd09c9afd24f864e0a3c95d7c933dbd8ab397ec2d762f261ae769ee41f5a98c5035bfa81aae5532d51fefdac3f1b3e44f521d23427e955b507141ebd5f80ff
|
7
|
+
data.tar.gz: e0d209ec0fade494671b82135476e4056aac23383229a93439183ad9277641011e1d968d1eafae47ab121373e54f109a9767744787888d7f0388ca67d7cf9808
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -36,7 +36,7 @@ And some optional integrations that will be asked for on project's creation:
|
|
36
36
|
|
37
37
|
## Contributing
|
38
38
|
|
39
|
-
### How do
|
39
|
+
### How do I add something new to Potassium?
|
40
40
|
|
41
41
|
In the [lib/potassium/templates/application](lib/potassium/templates/application) folder, you will find [the template](lib/potassium/templates/application/template.rb). You should follow the next conventions to add something:
|
42
42
|
|
@@ -59,15 +59,15 @@ If you need to ask something to the user before doing something, follow the next
|
|
59
59
|
|
60
60
|
#### Install
|
61
61
|
|
62
|
-
Now, to add some behavior, thanks to the [DSL](docs/dsl.md) we have a kind of standard flow of what happens when a new project is created. To understand this better, please read [the template](lib/potassium/templates/application/template.rb).
|
62
|
+
Now, to add some behavior, thanks to the [DSL](docs/dsl.md) we have a kind of standard flow of what happens when a new project is created. To understand this better, please read [the template](lib/potassium/templates/application/template.rb). The structure looks like this:
|
63
63
|
|
64
64
|
1. Clean the Gemfile and add the base gems that rails needs to work.
|
65
|
-
2.
|
66
|
-
3.
|
67
|
-
4.
|
65
|
+
2. Run all the **asks** recipes.
|
66
|
+
3. Execute all the **recipes**, that are ruby files stored on the [recipes](lib/potassium/templates/application/recipes) folder. They specify what gems are needed and registers callbacks based on this process, usually to execute things after the gem installation happened or after some other recipe finished his work.
|
67
|
+
4. Install the gems, filling the Gemfile before with all the gathered gems.
|
68
68
|
5. Finally, create the database.
|
69
69
|
|
70
|
-
The main step is the
|
70
|
+
The main step is the 3rd, when we run the recipes. A recipe can do anything (because is a ruby script) but their responsability should be to gather gems and register callbacks for the process.
|
71
71
|
|
72
72
|
For example, if we want to create an optional recipe to add a gem called `banana_split` that needs to run a generator, we can do the following.
|
73
73
|
|
@@ -88,7 +88,7 @@ For example, if we want to create an optional recipe to add a gem called `banana
|
|
88
88
|
end
|
89
89
|
```
|
90
90
|
|
91
|
-
3. Create the **recipe**. Register a gem using `gather_gem` and
|
91
|
+
3. Create the **recipe**. Register a gem using `gather_gem` and create a callback to be called after the `gem_install` action succeded to run the generator. `gem_install` is one of the main actions that should be easily visible with a sneak peek in [the template](lib/potassium/templates/application/template.rb).
|
92
92
|
|
93
93
|
```ruby
|
94
94
|
# application/recipes/banana_split.rb
|
@@ -114,4 +114,4 @@ For example, if we want to create an optional recipe to add a gem called `banana
|
|
114
114
|
|
115
115
|
#### The DSL
|
116
116
|
|
117
|
-
To see
|
117
|
+
To see further documentation of what we added to the rails template's DSL, check the [DSL documentation](docs/dsl.md). Remember that the DSL we are documenting is an extension over the [Rails Application Template DSL](http://edgeguides.rubyonrails.org/rails_application_templates.html), that itself is a dsl based on [Thor](https://github.com/erikhuda/thor/wiki).
|
@@ -1,2 +1,9 @@
|
|
1
1
|
gather_gem('rails-i18n')
|
2
|
-
|
2
|
+
|
3
|
+
if equals?(:lang, 'es')
|
4
|
+
template 'assets/es.yml', 'config/locales/es.yml'
|
5
|
+
end
|
6
|
+
|
7
|
+
gsub_file 'config/application.rb', /# config\.i18n\.default_locale =[^\n]+\n/ do
|
8
|
+
"config.i18n.default_locale = :#{get(:lang)}\n"
|
9
|
+
end
|
data/lib/potassium/version.rb
CHANGED
data/potassium.gemspec
CHANGED
@@ -18,9 +18,9 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.
|
22
|
-
spec.
|
23
|
-
spec.
|
24
|
-
spec.
|
25
|
-
spec.
|
21
|
+
spec.add_runtime_dependency "bundler", "~> 1.7"
|
22
|
+
spec.add_runtime_dependency "rake", "~> 10.0"
|
23
|
+
spec.add_runtime_dependency "gli", "~> 2.12.2"
|
24
|
+
spec.add_runtime_dependency "rails", "~> 4.2"
|
25
|
+
spec.add_runtime_dependency "inquirer", "~> 0.2"
|
26
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: potassium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- juliogarciag
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -17,7 +17,7 @@ dependencies:
|
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.7'
|
20
|
-
type: :
|
20
|
+
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
@@ -31,7 +31,7 @@ dependencies:
|
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
|
-
type: :
|
34
|
+
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
@@ -45,7 +45,7 @@ dependencies:
|
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 2.12.2
|
48
|
-
type: :
|
48
|
+
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '4.2'
|
62
|
-
type: :
|
62
|
+
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
@@ -73,7 +73,7 @@ dependencies:
|
|
73
73
|
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0.2'
|
76
|
-
type: :
|
76
|
+
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
@@ -89,6 +89,7 @@ extensions: []
|
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
91
|
- .gitignore
|
92
|
+
- CHANGELOG.md
|
92
93
|
- Gemfile
|
93
94
|
- LICENSE.txt
|
94
95
|
- README.md
|
@@ -121,6 +122,7 @@ files:
|
|
121
122
|
- lib/potassium/templates/application/recipes/asks/admin.rb
|
122
123
|
- lib/potassium/templates/application/recipes/asks/database.rb
|
123
124
|
- lib/potassium/templates/application/recipes/asks/devise.rb
|
125
|
+
- lib/potassium/templates/application/recipes/asks/lang.rb
|
124
126
|
- lib/potassium/templates/application/recipes/asks/pundit.rb
|
125
127
|
- lib/potassium/templates/application/recipes/bower.rb
|
126
128
|
- lib/potassium/templates/application/recipes/database.rb
|