sanji 1.0.0.pre.5 → 1.0.0.pre.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14ba224e7a05f550d0248df7e734d610d5d548a9
4
- data.tar.gz: 742c4417b7e9c7a66802cf4e535790610b96f0d9
3
+ metadata.gz: be44ca01be2800361c2d212fc914c24206368502
4
+ data.tar.gz: 38e84d77da15e4824ce7643bdae1a33f58922934
5
5
  SHA512:
6
- metadata.gz: fd1c2ff58dd300468c0efc2bca26c3d925d9300c7697a03723c9f80a8f5b2755c5ae4d33c85c5f0e388edb311aa972bfbabdb3fbda0444f1fd9c52689dec4c14
7
- data.tar.gz: 6337c58ae4fc096b5d7092a10dcffd084bb012f5b6abd55c09ae7bb41bfae5febaf0ba3481751726c1ae0bd8ae91e24470c68fdbcaeac63aec96ff7f92cb9a28
6
+ metadata.gz: 26e72b46571f80f3a4043a10b439fa09e740a00135031ae1a82e1e1376ebb5b014e4a480c088b1f52db6df1bd1938819c11e080ea0671ca5013754ba4cb2aa1e
7
+ data.tar.gz: 460ffe97b8a2fa61aafc4e29e9f369df495d448660bb62f283ecdda0e67bb8c1a51219abbb443ba4a5c6152c48dc9da1ba0c9c838088b2f5d442a67a30cebf7b
data/lib/sanji.yml CHANGED
@@ -8,8 +8,8 @@ cookbooks:
8
8
  - _figaro
9
9
  - _haml
10
10
  - _draper
11
- - _paloma
12
11
  - _reform
12
+ - _paloma
13
13
  - _frontend
14
14
  - _simple_gems
15
15
  - _public_module
@@ -2,6 +2,7 @@ class Sanji::Recipes::Frontend < Sanji::Recipe
2
2
 
3
3
  def after_create
4
4
  self.application_css_to_scss
5
+ self.delete_application_scss_contents
5
6
 
6
7
  if self.use_bootstrap?
7
8
  self.setup_bootstrap
@@ -18,6 +19,10 @@ class Sanji::Recipes::Frontend < Sanji::Recipe
18
19
  end
19
20
  end
20
21
 
22
+ def delete_application_scss_contents
23
+ a.gsub_file 'app/assets/stylesheets/application.scss', /(\S|\s)*/, ''
24
+ end
25
+
21
26
  def use_bootstrap?
22
27
  a.yes? 'Use twitter bootstrap css and javascripts?'
23
28
  end
@@ -25,11 +30,10 @@ class Sanji::Recipes::Frontend < Sanji::Recipe
25
30
  def setup_bootstrap
26
31
  a.add_gem 'bootstrap-sass'
27
32
 
28
- a.insert_into_file 'app/assets/stylesheets/application.scss',
29
- :after => "*/\n" do
30
- "@import 'bootstrap-sprockets';\n" \
31
- "@import 'bootstrap';\n"
32
- end
33
+ a.append_to_file 'app/assets/stylesheets/application.scss' do
34
+ "@import 'bootstrap-sprockets';\n" \
35
+ "@import 'bootstrap';\n"
36
+ end
33
37
 
34
38
  a.insert_into_file 'app/assets/javascripts/application.js',
35
39
  "//= require bootstrap-sprockets\n",
@@ -39,9 +43,9 @@ class Sanji::Recipes::Frontend < Sanji::Recipe
39
43
  def setup_normalize
40
44
  a.add_gem 'normalize-rails'
41
45
 
42
- a.insert_into_file 'app/assets/stylesheets/application.scss',
43
- "@import 'normalize-rails';\n",
44
- :after => "*/\n"
46
+ a.append_to_file 'app/assets/stylesheets/application.scss' do
47
+ "@import 'normalize-rails';\n"
48
+ end
45
49
  end
46
50
 
47
51
  end
@@ -1,5 +1,9 @@
1
1
  class Sanji::Recipes::Reform < Sanji::Recipe
2
2
 
3
+ def confirm
4
+ 'Do you want to use Reform?'
5
+ end
6
+
3
7
  def after_create
4
8
  a.add_gem 'reform'
5
9
  a.add_gem 'virtus'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sanji
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.5
4
+ version: 1.0.0.pre.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Paragua