mountain_view 0.3.1 → 0.3.2

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: 6560f4d39d31e2e4d03782a0113f24cd27bbc1dd
4
- data.tar.gz: 3f184bf80b977d91db928998f70fe8130c413d11
3
+ metadata.gz: d58f258908920f91b5f18ba52bd647029a15ee83
4
+ data.tar.gz: a77389d0a639cfd33bdb97b427a43b2ec93d8929
5
5
  SHA512:
6
- metadata.gz: c607e2ff9d82faad4b4453cc5f9258eec5bb35953d6573170cf4249afc1c2d3eb02b0a933c7440fec09c8333cb1081c4e444a5555a219b1c04d4971faf79222f
7
- data.tar.gz: 4d77b6d9afe2add7e091538b83fad3bf2e5c01a3a89fd459a0b004fec8d6634e3c1eb99eef8387388447434e03da1ca120b5d87d01bfcfa816fa4ea0cfca9a27
6
+ metadata.gz: 26f74e9e9ba17ac91b2faac4b39648186be503816205b721a55a1de054418d6abaff4028883b05fa8f21de36f78827b78883bcc70c1a49e99949b6e16cf5d910
7
+ data.tar.gz: a3db37b6d0d3cf21b85d975fd19c2125dd974c68e2567c84cff6863910d00bdcc72a75088b03da86605fdcc8c12b38ceaa67e36eb7c51719dc7f44b31d5ee004
@@ -9,20 +9,38 @@ module MountainView
9
9
  desc: "Component name, e.g: header, widget"
10
10
 
11
11
  def create_view_file
12
- create_file "app/components/#{component}/_#{component}.html.erb"
12
+ create_file "app/components/#{component}/_#{component}.html.#{template_engine}"
13
13
  end
14
14
 
15
15
  def create_css_file
16
- create_file "app/components/#{component}/#{component}.css"
16
+ create_file "app/components/#{component}/#{component}.#{stylesheet_engine}"
17
17
  end
18
18
 
19
19
  def create_js_file
20
- create_file "app/components/#{component}/#{component}.js"
20
+ create_file "app/components/#{component}/#{component}.#{javascript_engine}"
21
21
  end
22
22
 
23
23
  def create_stubs_file
24
24
  create_file "app/components/#{component}/#{component}.yml"
25
25
  end
26
+
27
+ private
28
+
29
+ def template_engine
30
+ app_generators[:template_engine] || "erb"
31
+ end
32
+
33
+ def stylesheet_engine
34
+ app_generators[:stylesheet_engine] || "css"
35
+ end
36
+
37
+ def javascript_engine
38
+ app_generators[:javascript_engine] || "js"
39
+ end
40
+
41
+ def app_generators
42
+ Rails.application.config.generators.rails
43
+ end
26
44
  end
27
45
  end
28
46
  end
@@ -1,3 +1,3 @@
1
1
  module MountainView
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -1509,3 +1509,81 @@ MountainView::ComponentHelperTest: test_renders_the_proper_component
1509
1509
  ------------------------------------------------------------------
1510
1510
  ComponentGeneratorTest: test_Assert_all_files_are_properly_created
1511
1511
  ------------------------------------------------------------------
1512
+ ------------------------------------------------------------------
1513
+ ComponentGeneratorTest: test_Assert_all_files_are_properly_created
1514
+ ------------------------------------------------------------------
1515
+ --------------------------------------------------------------------
1516
+ MountainView::ComponentHelperTest: test_renders_the_proper_component
1517
+ --------------------------------------------------------------------
1518
+ Rendered app/components/header/_header.html.erb (1.6ms)
1519
+ ------------------------------------------------------
1520
+ MountainViewTest: test_javascripts_are_properly_served
1521
+ ------------------------------------------------------
1522
+ Started GET "/assets/mountain_view.js" for 127.0.0.1 at 2015-04-14 11:15:53 -0400
1523
+ ---------------------------------------
1524
+ MountainViewTest: test_engine_is_loaded
1525
+ ---------------------------------------
1526
+ ------------------------------------------------------
1527
+ MountainViewTest: test_stylesheets_are_properly_served
1528
+ ------------------------------------------------------
1529
+ Started GET "/assets/mountain_view.css" for 127.0.0.1 at 2015-04-14 11:15:53 -0400
1530
+ ------------------------------------------------------------------
1531
+ ComponentGeneratorTest: test_Assert_all_files_are_properly_created
1532
+ ------------------------------------------------------------------
1533
+ --------------------------------------------------------------------
1534
+ MountainView::ComponentHelperTest: test_renders_the_proper_component
1535
+ --------------------------------------------------------------------
1536
+ Rendered app/components/header/_header.html.erb (1.5ms)
1537
+ ---------------------------------------
1538
+ MountainViewTest: test_engine_is_loaded
1539
+ ---------------------------------------
1540
+ ------------------------------------------------------
1541
+ MountainViewTest: test_javascripts_are_properly_served
1542
+ ------------------------------------------------------
1543
+ Started GET "/assets/mountain_view.js" for 127.0.0.1 at 2015-04-14 12:09:39 -0400
1544
+ ------------------------------------------------------
1545
+ MountainViewTest: test_stylesheets_are_properly_served
1546
+ ------------------------------------------------------
1547
+ Started GET "/assets/mountain_view.css" for 127.0.0.1 at 2015-04-14 12:09:39 -0400
1548
+ ---------------------------------------
1549
+ MountainViewTest: test_engine_is_loaded
1550
+ ---------------------------------------
1551
+ ------------------------------------------------------
1552
+ MountainViewTest: test_stylesheets_are_properly_served
1553
+ ------------------------------------------------------
1554
+ Started GET "/assets/mountain_view.css" for 127.0.0.1 at 2015-04-14 12:11:07 -0400
1555
+ ------------------------------------------------------
1556
+ MountainViewTest: test_javascripts_are_properly_served
1557
+ ------------------------------------------------------
1558
+ Started GET "/assets/mountain_view.js" for 127.0.0.1 at 2015-04-14 12:11:07 -0400
1559
+ ------------------------------------------------------------------
1560
+ ComponentGeneratorTest: test_Assert_all_files_are_properly_created
1561
+ ------------------------------------------------------------------
1562
+ --------------------------------------------------------
1563
+ ComponentGeneratorTest: test_Generates_different_engines
1564
+ --------------------------------------------------------
1565
+ --------------------------------------------------------------------
1566
+ MountainView::ComponentHelperTest: test_renders_the_proper_component
1567
+ --------------------------------------------------------------------
1568
+ Rendered app/components/header/_header.html.erb (1.2ms)
1569
+ ---------------------------------------
1570
+ MountainViewTest: test_engine_is_loaded
1571
+ ---------------------------------------
1572
+ ------------------------------------------------------
1573
+ MountainViewTest: test_stylesheets_are_properly_served
1574
+ ------------------------------------------------------
1575
+ Started GET "/assets/mountain_view.css" for 127.0.0.1 at 2015-04-14 12:11:22 -0400
1576
+ ------------------------------------------------------
1577
+ MountainViewTest: test_javascripts_are_properly_served
1578
+ ------------------------------------------------------
1579
+ Started GET "/assets/mountain_view.js" for 127.0.0.1 at 2015-04-14 12:11:22 -0400
1580
+ --------------------------------------------------------------------
1581
+ MountainView::ComponentHelperTest: test_renders_the_proper_component
1582
+ --------------------------------------------------------------------
1583
+ Rendered app/components/header/_header.html.erb (1.9ms)
1584
+ ------------------------------------------------------------------
1585
+ ComponentGeneratorTest: test_Assert_all_files_are_properly_created
1586
+ ------------------------------------------------------------------
1587
+ --------------------------------------------------------
1588
+ ComponentGeneratorTest: test_Generates_different_engines
1589
+ --------------------------------------------------------
@@ -14,4 +14,17 @@ class ComponentGeneratorTest < Rails::Generators::TestCase
14
14
  assert_file "app/components/widget/widget.js"
15
15
  assert_file "app/components/widget/widget.yml"
16
16
  end
17
+
18
+ test "Generates different engines" do
19
+ Rails.application.config.app_generators.template_engine :haml
20
+ Rails.application.config.app_generators.stylesheet_engine :scss
21
+ Rails.application.config.app_generators.javascript_engine :coffee
22
+
23
+ run_generator %w( widget )
24
+
25
+ assert_file "app/components/widget/_widget.html.haml"
26
+ assert_file "app/components/widget/widget.scss"
27
+ assert_file "app/components/widget/widget.coffee"
28
+ assert_file "app/components/widget/widget.yml"
29
+ end
17
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mountain_view
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ignacio Gutierrez
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-13 00:00:00.000000000 Z
12
+ date: 2015-04-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -119,9 +119,9 @@ files:
119
119
  - test/helpers/mountain_view/component_helper_test.rb
120
120
  - test/mountain_view_test.rb
121
121
  - test/test_helper.rb
122
- - test/tmp/app/components/widget/_widget.html.erb
123
- - test/tmp/app/components/widget/widget.css
124
- - test/tmp/app/components/widget/widget.js
122
+ - test/tmp/app/components/widget/_widget.html.haml
123
+ - test/tmp/app/components/widget/widget.coffee
124
+ - test/tmp/app/components/widget/widget.scss
125
125
  - test/tmp/app/components/widget/widget.yml
126
126
  homepage: http://github.com/jgnatch/mountain_view
127
127
  licenses:
@@ -200,7 +200,7 @@ test_files:
200
200
  - test/helpers/mountain_view/component_helper_test.rb
201
201
  - test/mountain_view_test.rb
202
202
  - test/test_helper.rb
203
- - test/tmp/app/components/widget/_widget.html.erb
204
- - test/tmp/app/components/widget/widget.css
205
- - test/tmp/app/components/widget/widget.js
203
+ - test/tmp/app/components/widget/_widget.html.haml
204
+ - test/tmp/app/components/widget/widget.coffee
205
+ - test/tmp/app/components/widget/widget.scss
206
206
  - test/tmp/app/components/widget/widget.yml