ggake 0.3.1 → 0.4.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: 577ad82f0e6b76666e30a299829f6e795087bf72
4
- data.tar.gz: 9526b01ebce63b3903099c7a4e64ecfcdb8daf38
3
+ metadata.gz: 4f781d94fafffffc84a36ecc33041ab744976fb1
4
+ data.tar.gz: 11f655d9c98d8b5cb0ba6c7fa72f38829a5712f3
5
5
  SHA512:
6
- metadata.gz: 59122898f6786cbacc022be0bfe51c46dd58c540385279c5ad94754c576e483e3198212bc191122e5c1b4e24a2ce8eb82b3e44ffb95bc4d48dbfff8d3a679bb4
7
- data.tar.gz: 31e34f9bfdc8f11dd00c476e45c17d022c1c0bc348ac4e9e84091b18e026fc8bdaabb704a79c9a60695f58397544dd0756a81d1e0f2bb1280e7ea36cab9911a7
6
+ metadata.gz: 41e8e4f4ee2a8968f41b59d0ddce5359b09d2f1f063e1d7ed5d135b90b2703da11bf3f09426c01f4fabb5c59e092486c558647d7d9fa7d102abf8106da0de18a
7
+ data.tar.gz: 068970b5c5de181923957431596575c1db2635330072a28a9df6ccb0d416f2dda8c88ed2cf674228a6b20c016f17f9f96cf4e47012ece05c38b09755398119e3
data/Rakefile CHANGED
@@ -1,6 +1,10 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
+ require 'cucumber/rake/task'
3
4
 
4
5
  RSpec::Core::RakeTask.new(:spec)
6
+ Cucumber::Rake::Task.new(:features) do |t|
7
+ t.cucumber_opts = %w{--format pretty}
8
+ end
5
9
 
6
- task :default => :spec
10
+ task :default => [:features, :spec]
@@ -0,0 +1,24 @@
1
+ Feature: Haml templating
2
+ In order to save my fingers and keyboard
3
+ As a programmer building single-page apps
4
+ I want to be able to write my static pages in Haml instead of HTML
5
+
6
+ Scenario: Create an HTML file from a Haml template
7
+ Given a file named "template.haml" with:
8
+ """
9
+ !!!
10
+ %html
11
+ """
12
+ When I run a haml task on "template.haml"
13
+ Then a file named "template.html" should exist
14
+ And the file "template.html" should contain:
15
+ """
16
+ <!DOCTYPE html>
17
+ <html></html>
18
+ """
19
+
20
+ Scenario: Create any required output directories for storing Haml output
21
+ Given an empty file named "src/views/template.haml"
22
+ When I run a haml task on "src/views/template.haml" with output to "static/pages"
23
+ Then a directory named "static/pages" should exist
24
+ And a file named "static/pages/template.html" should exist
@@ -0,0 +1,3 @@
1
+ When /^I run a haml task on "([^"]*)"$/, :run_haml
2
+ When /^I run a haml task on "([^"]*)" with output to "([^"]*)"$/, :run_haml
3
+
@@ -0,0 +1,19 @@
1
+ require 'aruba/cucumber'
2
+
3
+ require 'rake'
4
+ require 'ggake'
5
+
6
+ module GgakeWorld
7
+ include Rake::DSL
8
+
9
+ def run_haml(haml_file, output_dir = './')
10
+ in_current_dir do
11
+ file haml_file
12
+ tname = haml_template(haml_file, output: output_dir)
13
+ Rake::Task[tname].invoke
14
+ end
15
+ end
16
+
17
+ end
18
+
19
+ World(GgakeWorld)
data/ggake.gemspec CHANGED
@@ -23,5 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "bundler", "~> 1.3"
24
24
  spec.add_development_dependency "rake"
25
25
  spec.add_development_dependency "rspec"
26
+ spec.add_development_dependency "aruba"
26
27
  spec.add_development_dependency "fog"
28
+ spec.add_development_dependency "haml"
27
29
  end
data/lib/ggake/haml.rb CHANGED
@@ -2,8 +2,9 @@ module Rake
2
2
  module DSL
3
3
 
4
4
  def haml_template(tmpl, options)
5
- File.join(options[:output], tmpl).ext('html').tap do |html_file|
6
- file html_file => tmpl do
5
+ File.join(options[:output], File.basename(tmpl)).ext('html').tap do |html_file|
6
+ directory options[:output]
7
+ file html_file => [options[:output], tmpl] do
7
8
  sh "haml #{tmpl} #{html_file}"
8
9
  end
9
10
  end
data/lib/ggake/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ggake
2
- VERSION = "0.3.1"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ggake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giles Alexander
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-09 00:00:00.000000000 Z
11
+ date: 2013-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: aruba
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: fog
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +94,20 @@ dependencies:
80
94
  - - '>='
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: haml
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
83
111
  description: A collection of useful Rake utilities
84
112
  email:
85
113
  - giles.alexander@gmail.com
@@ -96,6 +124,9 @@ files:
96
124
  - LICENSE.txt
97
125
  - README.md
98
126
  - Rakefile
127
+ - features/haml.feature
128
+ - features/step_definitions.rb/haml_steps.rb
129
+ - features/support/env.rb
99
130
  - ggake.gemspec
100
131
  - lib/ggake.rb
101
132
  - lib/ggake/cloud_cp.rb
@@ -131,6 +162,9 @@ signing_key:
131
162
  specification_version: 4
132
163
  summary: A collection of useful Rake utilities
133
164
  test_files:
165
+ - features/haml.feature
166
+ - features/step_definitions.rb/haml_steps.rb
167
+ - features/support/env.rb
134
168
  - spec/cloud_cp_spec.rb
135
169
  - spec/ggake_spec.rb
136
170
  - spec/spec_helper.rb