scad4r 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -3,12 +3,16 @@ source "http://rubygems.org"
3
3
  gem "childprocess", "~> 0.3"
4
4
 
5
5
  group :development do
6
+ gem "aruba", "~> 0.5"
7
+
6
8
  gem "growl", "~> 1.0"
7
9
  gem "guard", "~> 1.6"
10
+ gem "guard-cucumber", "~> 1.3"
8
11
  gem "guard-rspec", "~> 2.3"
9
12
 
10
13
  gem "jeweler", "~> 1.8.3"
11
14
 
15
+ gem "pry", "~> 0.9", require: true
12
16
  gem "rdoc", "~> 3.12"
13
17
  gem "rspec", "~> 2.12"
14
18
  gem "rb-fsevent", "~> 0.9"
data/Guardfile CHANGED
@@ -3,3 +3,9 @@ guard :rspec do
3
3
  watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
4
4
  watch('spec/spec_helper.rb') { "spec" }
5
5
  end
6
+
7
+ guard 'cucumber' do
8
+ watch(%r{^features/.+\.feature$})
9
+ watch(%r{^features/support/.+$}) { 'features' }
10
+ watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
11
+ end
data/Rakefile CHANGED
@@ -33,7 +33,10 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
33
33
  spec.rspec_opts = "-r simplecov -p"
34
34
  end
35
35
 
36
- task :default => [:spec]
36
+ require 'cucumber/rake/task'
37
+ Cucumber::Rake::Task.new(:features)
38
+
39
+ task :default => [:spec, :features]
37
40
 
38
41
  require 'rdoc/task'
39
42
  Rake::RDocTask.new do |rdoc|
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -0,0 +1,10 @@
1
+ Feature: I want to run openscad from ruby
2
+
3
+ Scenario: Run openscad on a file
4
+ Given I have a Scad4r::Runner
5
+ And a file named "cube.scad" with:
6
+ """
7
+ cube(10,10,10);
8
+ """
9
+ When I run "cube.scad" through the Scad4r::Runner
10
+ And a file named "cube.stl" should exist
@@ -0,0 +1,9 @@
1
+ Given /^I have a Scad4r::Runner$/ do
2
+ self.runner= Scad4r::Runner.new
3
+ end
4
+
5
+ When /^I run "(.*?)" through the Scad4r::Runner$/ do |path|
6
+ in_current_dir do
7
+ self.last_results= runner.run(path)
8
+ end
9
+ end
@@ -0,0 +1,41 @@
1
+ require 'bundler'
2
+
3
+ require 'simplecov'
4
+
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+
13
+ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
14
+
15
+ require 'rspec/expectations'
16
+ require 'aruba/cucumber'
17
+
18
+ require 'scad4r/runner'
19
+
20
+ require 'pry'
21
+
22
+ module FeatureStateHelpers
23
+
24
+ def last_results=(results)
25
+ @results = results
26
+ end
27
+
28
+ def last_results
29
+ @results
30
+ end
31
+
32
+ def runner=(a_runner)
33
+ @runner = a_runner
34
+ end
35
+
36
+ def runner
37
+ @runner
38
+ end
39
+ end
40
+
41
+ World(FeatureStateHelpers)
@@ -32,7 +32,7 @@ module Scad4r
32
32
 
33
33
  protected
34
34
 
35
- def shell_out(*cmd)
35
+ def shell_out(cmd)
36
36
  r, w = pipes
37
37
  process = ChildProcess.build(*cmd)
38
38
  process.io.stdout = process.io.stderr = w
@@ -64,7 +64,7 @@ module Scad4r
64
64
  def runtime_arguments(path, options)
65
65
  arguments = []
66
66
 
67
- arguments << "-o #{options.fetch(:output)}"
67
+ arguments << "-o#{options.fetch(:output)}"
68
68
 
69
69
  arguments.push(*setting_constants(options.fetch(:constants)))
70
70
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "scad4r"
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Caleb Buxton"]
12
- s.date = "2013-02-18"
12
+ s.date = "2013-03-08"
13
13
  s.description = "Provides Ruby affordances for scripting OpenSCAD"
14
14
  s.email = "me@cpb.ca"
15
15
  s.extra_rdoc_files = [
@@ -26,6 +26,9 @@ Gem::Specification.new do |s|
26
26
  "README.rdoc",
27
27
  "Rakefile",
28
28
  "VERSION",
29
+ "features/runner.feature",
30
+ "features/step_definitions/runner_steps.rb",
31
+ "features/support/env.rb",
29
32
  "lib/scad4r.rb",
30
33
  "lib/scad4r/notification.rb",
31
34
  "lib/scad4r/result_parser.rb",
@@ -53,10 +56,13 @@ Gem::Specification.new do |s|
53
56
 
54
57
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
55
58
  s.add_runtime_dependency(%q<childprocess>, ["~> 0.3"])
59
+ s.add_development_dependency(%q<aruba>, ["~> 0.5"])
56
60
  s.add_development_dependency(%q<growl>, ["~> 1.0"])
57
61
  s.add_development_dependency(%q<guard>, ["~> 1.6"])
62
+ s.add_development_dependency(%q<guard-cucumber>, ["~> 1.3"])
58
63
  s.add_development_dependency(%q<guard-rspec>, ["~> 2.3"])
59
64
  s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
65
+ s.add_development_dependency(%q<pry>, ["~> 0.9"])
60
66
  s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
61
67
  s.add_development_dependency(%q<rspec>, ["~> 2.12"])
62
68
  s.add_development_dependency(%q<rb-fsevent>, ["~> 0.9"])
@@ -64,10 +70,13 @@ Gem::Specification.new do |s|
64
70
  s.add_development_dependency(%q<simplecov-csv>, ["~> 0.1"])
65
71
  else
66
72
  s.add_dependency(%q<childprocess>, ["~> 0.3"])
73
+ s.add_dependency(%q<aruba>, ["~> 0.5"])
67
74
  s.add_dependency(%q<growl>, ["~> 1.0"])
68
75
  s.add_dependency(%q<guard>, ["~> 1.6"])
76
+ s.add_dependency(%q<guard-cucumber>, ["~> 1.3"])
69
77
  s.add_dependency(%q<guard-rspec>, ["~> 2.3"])
70
78
  s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
79
+ s.add_dependency(%q<pry>, ["~> 0.9"])
71
80
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
72
81
  s.add_dependency(%q<rspec>, ["~> 2.12"])
73
82
  s.add_dependency(%q<rb-fsevent>, ["~> 0.9"])
@@ -76,10 +85,13 @@ Gem::Specification.new do |s|
76
85
  end
77
86
  else
78
87
  s.add_dependency(%q<childprocess>, ["~> 0.3"])
88
+ s.add_dependency(%q<aruba>, ["~> 0.5"])
79
89
  s.add_dependency(%q<growl>, ["~> 1.0"])
80
90
  s.add_dependency(%q<guard>, ["~> 1.6"])
91
+ s.add_dependency(%q<guard-cucumber>, ["~> 1.3"])
81
92
  s.add_dependency(%q<guard-rspec>, ["~> 2.3"])
82
93
  s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
94
+ s.add_dependency(%q<pry>, ["~> 0.9"])
83
95
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
84
96
  s.add_dependency(%q<rspec>, ["~> 2.12"])
85
97
  s.add_dependency(%q<rb-fsevent>, ["~> 0.9"])
@@ -55,7 +55,7 @@ module Scad4r
55
55
 
56
56
  it "runs with the option" do
57
57
  subject.should run_openscad.
58
- with("-o #{passed_file.sub_ext(".csg")}").
58
+ with("-o#{passed_file.sub_ext(".csg")}").
59
59
  on(passed_file)
60
60
 
61
61
  subject.run(passed_file, format: :csg)
@@ -66,7 +66,7 @@ module Scad4r
66
66
  context "format: :stl" do
67
67
  it "creates stl files" do
68
68
  subject.should run_openscad.
69
- with("-o #{passed_file.sub_ext(".stl")}").
69
+ with("-o#{passed_file.sub_ext(".stl")}").
70
70
  on(passed_file)
71
71
 
72
72
  subject.run(passed_file, format: :stl)
@@ -76,7 +76,7 @@ module Scad4r
76
76
  context "format: :csg" do
77
77
  it "creates csg files" do
78
78
  subject.should run_openscad.
79
- with("-o #{passed_file.sub_ext(".csg")}").
79
+ with("-o#{passed_file.sub_ext(".csg")}").
80
80
  on(passed_file)
81
81
 
82
82
  subject.run(passed_file, format: :csg)
@@ -22,7 +22,7 @@ module OpenscadExecutionMatcher
22
22
  openscad_runner.stub(:pipes).and_return([
23
23
  read_pipe_double(@mock_result),write_pipe_double])
24
24
 
25
- ChildProcess.should_receive(:build) do |arguments|
25
+ ChildProcess.should_receive(:build) do |*arguments|
26
26
  options = arguments.pop if arguments.last.is_a?(Hash)
27
27
 
28
28
  arguments.shift(@expected_openscad_invocation.length).should eql(@expected_openscad_invocation)
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: scad4r
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.0
5
+ version: 0.2.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Caleb Buxton
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-18 00:00:00.000000000 Z
12
+ date: 2013-03-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  type: :runtime
@@ -27,6 +27,22 @@ dependencies:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0.3'
30
+ - !ruby/object:Gem::Dependency
31
+ type: :development
32
+ version_requirements: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '0.5'
38
+ name: aruba
39
+ prerelease: false
40
+ requirement: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '0.5'
30
46
  - !ruby/object:Gem::Dependency
31
47
  type: :development
32
48
  version_requirements: !ruby/object:Gem::Requirement
@@ -59,6 +75,22 @@ dependencies:
59
75
  - - ~>
60
76
  - !ruby/object:Gem::Version
61
77
  version: '1.6'
78
+ - !ruby/object:Gem::Dependency
79
+ type: :development
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: '1.3'
86
+ name: guard-cucumber
87
+ prerelease: false
88
+ requirement: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: '1.3'
62
94
  - !ruby/object:Gem::Dependency
63
95
  type: :development
64
96
  version_requirements: !ruby/object:Gem::Requirement
@@ -91,6 +123,22 @@ dependencies:
91
123
  - - ~>
92
124
  - !ruby/object:Gem::Version
93
125
  version: 1.8.3
126
+ - !ruby/object:Gem::Dependency
127
+ type: :development
128
+ version_requirements: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ~>
132
+ - !ruby/object:Gem::Version
133
+ version: '0.9'
134
+ name: pry
135
+ prerelease: false
136
+ requirement: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ~>
140
+ - !ruby/object:Gem::Version
141
+ version: '0.9'
94
142
  - !ruby/object:Gem::Dependency
95
143
  type: :development
96
144
  version_requirements: !ruby/object:Gem::Requirement
@@ -188,6 +236,9 @@ files:
188
236
  - README.rdoc
189
237
  - Rakefile
190
238
  - VERSION
239
+ - features/runner.feature
240
+ - features/step_definitions/runner_steps.rb
241
+ - features/support/env.rb
191
242
  - lib/scad4r.rb
192
243
  - lib/scad4r/notification.rb
193
244
  - lib/scad4r/result_parser.rb
@@ -217,7 +268,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
217
268
  - !ruby/object:Gem::Version
218
269
  segments:
219
270
  - 0
220
- hash: -3905703001506090554
271
+ hash: 198757374685059186
221
272
  version: '0'
222
273
  required_rubygems_version: !ruby/object:Gem::Requirement
223
274
  none: false