potassium 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dbbae269a8525af660d5f14aabf1fcfba6983e58
4
- data.tar.gz: 5760d02a273c5c3bf4ab3d97c380206c224af897
3
+ metadata.gz: 44f4877e46ff82660a1c6be6f8f4f7afe69c702d
4
+ data.tar.gz: 5f2202a4a00fb64e25a77bf8dd0bb71f9998273d
5
5
  SHA512:
6
- metadata.gz: 1fe7819245a24592988c21856d674125ee563ef441b9058cabec7c00d0913c6777e814061bdfcf62ce85262451589b1b8513bdd3bf6bb77b69594fd5d1a281eb
7
- data.tar.gz: fa72ded8a7c6d245dd957e387e1abea1978c22e4ca3ec7be3249d55541ee69c2c8ce9e6d6e3e0cf21890af68c684914fa29760909b67d1f5ff026a11960f1059
6
+ metadata.gz: 61fd09c9afd24f864e0a3c95d7c933dbd8ab397ec2d762f261ae769ee41f5a98c5035bfa81aae5532d51fefdac3f1b3e44f521d23427e955b507141ebd5f80ff
7
+ data.tar.gz: e0d209ec0fade494671b82135476e4056aac23383229a93439183ad9277641011e1d968d1eafae47ab121373e54f109a9767744787888d7f0388ca67d7cf9808
data/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ ## 1.0.1
2
+
3
+ Bugfixes:
4
+ - Removed `default_command` call to fix --version usage.
5
+
6
+ ## 1.1.0
7
+
8
+ Bugfixes:
9
+ - Fixed dependencies management.
10
+
11
+ Features:
12
+ - Added a question for choosing application language and integration with devise-i18n.
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 i add something new to Potassium?
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). Anyway, the structure is like this:
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. Then, run all the **asks** recipes.
66
- 3. Then, 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. Then, install the gems, filling the Gemfile before with all the gathered gems.
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 3, when we run the recipes. A recipe can do anything (because is a ruby script) but what should be their main responsabilities are to gather gems and register callbacks for the process.
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 use a callback to run 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).
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 some 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).
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).
@@ -0,0 +1,8 @@
1
+ languages = {
2
+ "Spanish" => "es",
3
+ "English" => "en"
4
+ }
5
+
6
+ lang = languages.values[Ask.list("What is the main language of your app?", languages.keys)]
7
+
8
+ set(:lang, lang)
@@ -1,6 +1,7 @@
1
1
  authentication_framework = {
2
2
  devise: ->{
3
3
  gather_gem 'devise'
4
+ gather_gem 'devise-i18n'
4
5
 
5
6
  after(:gem_install) do
6
7
  generate "devise:install"
@@ -1,2 +1,9 @@
1
1
  gather_gem('rails-i18n')
2
- template 'assets/es.yml', 'config/locales/es.yml'
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
@@ -18,6 +18,7 @@ run_action(:asking) do
18
18
  eval_file "recipes/asks/devise.rb"
19
19
  eval_file "recipes/asks/admin.rb"
20
20
  eval_file "recipes/asks/pundit.rb"
21
+ eval_file "recipes/asks/lang.rb"
21
22
  end
22
23
 
23
24
  run_action(:recipe_loading) do
@@ -1,3 +1,3 @@
1
1
  module Potassium
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
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.add_development_dependency "bundler", "~> 1.7"
22
- spec.add_development_dependency "rake", "~> 10.0"
23
- spec.add_development_dependency "gli", "~> 2.12.2"
24
- spec.add_development_dependency "rails", "~> 4.2"
25
- spec.add_development_dependency "inquirer", "~> 0.2"
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.1
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-09 00:00:00.000000000 Z
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: :development
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: :development
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: :development
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: :development
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: :development
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