middleman-react 0.0.2 → 0.10.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: 35510ec9e91bb2fd6a8a200f6817d22e8f695095
4
- data.tar.gz: 700329f8bd7d2dcba06feda459014cd06f47cc20
3
+ metadata.gz: a4ed702ae7fb0dcc012f9395c3fb5b60c906b183
4
+ data.tar.gz: 6f5cb57be449fc82af88b03c7dc5612838f1fc91
5
5
  SHA512:
6
- metadata.gz: 3035b2b0bf86be8bba70568b477bc1a37496f146f516fce62a7e2154edb9a20ae7cc56a29b95263173567bff1cf9edebebf156b15bb3f62286d7a8f435d3317d
7
- data.tar.gz: 8c46110512f2967bb9fb5e7967d34d0abf8452c198b5852b400c5cf7a4f8a681173a4daff895241f6f87c3e4a7c753a8c1b88bcc515173163e7a0557ad006760
6
+ metadata.gz: 53f50aaef49fe6ecfd7bbc65d45971531c09f7a5a4ddb681fb1badeff3acd8cf88968830448edb479743db5d090c87c89629c229f84f5671dc4302b4961f09c7
7
+ data.tar.gz: 28c97fe808fa12aff3b7c8aed70da5e3caf0a63db76b0074532569f4cbe07a3b00d17cc9ef0dbbe571e5b0dda1f04ada593f9c92d5a38145cede700f4e62f688
data/.gitignore CHANGED
@@ -11,6 +11,8 @@ spec/reports
11
11
  test/tmp
12
12
  test/version_tmp
13
13
  tmp
14
+ bin
15
+ fixtures/build
14
16
 
15
17
  # YARD artifacts
16
18
  .yardoc
data/.travis.yml ADDED
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ bundler_args: --binstubs
3
+ rvm:
4
+ - 2.1.0
5
+ - 2.0.0
6
+ - 1.9.3
7
+ script:
8
+ - script/spec
data/Gemfile.lock CHANGED
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- middleman-react (0.0.2)
4
+ middleman-react (0.10.0)
5
5
  execjs
6
6
  middleman-core (>= 3.0)
7
- react-source (= 0.8.0)
7
+ react-source (= 0.10.0)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
@@ -12,9 +12,6 @@ GEM
12
12
  activesupport (3.2.16)
13
13
  i18n (~> 0.6, >= 0.6.4)
14
14
  multi_json (~> 1.0)
15
- appraisal (0.5.2)
16
- bundler
17
- rake
18
15
  aruba (0.5.4)
19
16
  childprocess (>= 0.3.6)
20
17
  cucumber (>= 1.1.1)
@@ -25,13 +22,16 @@ GEM
25
22
  parallel
26
23
  childprocess (0.4.0)
27
24
  ffi (~> 1.0, >= 1.0.11)
25
+ chunky_png (1.2.9)
28
26
  coderay (1.1.0)
29
- coveralls (0.7.0)
30
- multi_json (~> 1.3)
31
- rest-client
32
- simplecov (>= 0.7)
33
- term-ansicolor
34
- thor
27
+ coffee-script (2.2.0)
28
+ coffee-script-source
29
+ execjs
30
+ coffee-script-source (1.7.0)
31
+ compass (0.12.2)
32
+ chunky_png (~> 1.2)
33
+ fssm (>= 0.2.7)
34
+ sass (~> 3.1)
35
35
  cucumber (1.3.10)
36
36
  builder (>= 2.1.2)
37
37
  diff-lcs (>= 1.1.3)
@@ -39,18 +39,33 @@ GEM
39
39
  multi_json (>= 1.7.5, < 2.0)
40
40
  multi_test (>= 0.0.2)
41
41
  diff-lcs (1.2.5)
42
- docile (1.1.3)
43
- execjs (2.0.2)
42
+ execjs (1.4.0)
43
+ multi_json (~> 1.0)
44
44
  ffi (1.9.3)
45
+ fssm (0.2.10)
45
46
  gherkin (2.12.2)
46
47
  multi_json (~> 1.3)
48
+ haml (4.0.5)
49
+ tilt
50
+ hike (1.2.3)
47
51
  i18n (0.6.9)
48
52
  json (1.8.1)
53
+ kramdown (1.3.1)
49
54
  listen (1.3.1)
50
55
  rb-fsevent (>= 0.9.3)
51
56
  rb-inotify (>= 0.9)
52
57
  rb-kqueue (>= 0.2)
53
58
  method_source (0.8.2)
59
+ middleman (3.2.2)
60
+ coffee-script (~> 2.2.0)
61
+ compass (>= 0.12.2)
62
+ execjs (~> 1.4.0)
63
+ haml (>= 3.1.6)
64
+ kramdown (~> 1.2)
65
+ middleman-core (= 3.2.2)
66
+ middleman-sprockets (>= 3.1.2)
67
+ sass (>= 3.1.20)
68
+ uglifier (~> 2.4.0)
54
69
  middleman-core (3.2.2)
55
70
  activesupport (~> 3.2.6)
56
71
  bundler (~> 1.1)
@@ -60,7 +75,11 @@ GEM
60
75
  rack-test (~> 0.6.1)
61
76
  thor (>= 0.15.2, < 2.0)
62
77
  tilt (~> 1.4.1)
63
- mime-types (2.1)
78
+ middleman-sprockets (3.2.0)
79
+ middleman-core (~> 3.2)
80
+ sprockets (~> 2.1)
81
+ sprockets-helpers (~> 1.0.0)
82
+ sprockets-sass (~> 1.0.0)
64
83
  multi_json (1.8.4)
65
84
  multi_test (0.0.3)
66
85
  parallel (0.9.2)
@@ -68,14 +87,14 @@ GEM
68
87
  ast (~> 1.1)
69
88
  slop (~> 3.4, >= 3.4.5)
70
89
  powerpack (0.0.9)
71
- pry (0.9.12.4)
90
+ pry (0.9.12.6)
72
91
  coderay (~> 1.0)
73
92
  method_source (~> 0.8)
74
93
  slop (~> 3.4)
75
94
  rack (1.5.2)
76
95
  rack-test (0.6.2)
77
96
  rack (>= 1.0)
78
- rainbow (1.99.1)
97
+ rainbow (2.0.0)
79
98
  rake (0.9.6)
80
99
  rb-fsevent (0.9.4)
81
100
  rb-inotify (0.9.3)
@@ -84,9 +103,7 @@ GEM
84
103
  ffi (>= 0.5.0)
85
104
  rdoc (3.12.2)
86
105
  json (~> 1.4)
87
- react-source (0.8.0)
88
- rest-client (1.6.7)
89
- mime-types (>= 1.16)
106
+ react-source (0.10.0)
90
107
  rspec (2.14.1)
91
108
  rspec-core (~> 2.14.0)
92
109
  rspec-expectations (~> 2.14.0)
@@ -95,37 +112,42 @@ GEM
95
112
  rspec-expectations (2.14.5)
96
113
  diff-lcs (>= 1.1.3, < 2.0)
97
114
  rspec-mocks (2.14.5)
98
- rubocop (0.16.0)
99
- parser (~> 2.1)
115
+ rubocop (0.18.1)
116
+ json (>= 1.7.7, < 2)
117
+ parser (~> 2.1.3)
100
118
  powerpack (~> 0.0.6)
101
- rainbow (>= 1.1.4)
102
- simplecov (0.8.2)
103
- docile (~> 1.1.0)
104
- multi_json
105
- simplecov-html (~> 0.8.0)
106
- simplecov-html (0.8.0)
119
+ rainbow (>= 1.99.1, < 3.0)
120
+ sass (3.2.14)
107
121
  slop (3.4.7)
108
- term-ansicolor (1.2.2)
109
- tins (~> 0.8)
122
+ sprockets (2.10.1)
123
+ hike (~> 1.2)
124
+ multi_json (~> 1.0)
125
+ rack (~> 1.0)
126
+ tilt (~> 1.1, != 1.3.0)
127
+ sprockets-helpers (1.0.1)
128
+ sprockets (~> 2.0)
129
+ sprockets-sass (1.0.2)
130
+ sprockets (~> 2.0)
131
+ tilt (~> 1.1)
110
132
  thor (0.18.1)
111
133
  tilt (1.4.1)
112
- tins (0.13.2)
134
+ uglifier (2.4.0)
135
+ execjs (>= 0.3.0)
136
+ json (>= 1.8.0)
113
137
  yard (0.8.7.3)
114
138
 
115
139
  PLATFORMS
116
140
  ruby
117
141
 
118
142
  DEPENDENCIES
119
- appraisal
120
143
  aruba
121
144
  cane
122
- coveralls
123
145
  cucumber
146
+ middleman (~> 3.2)
124
147
  middleman-react!
125
148
  pry
126
149
  rake (~> 0.9.2)
127
150
  rdoc (~> 3.9)
128
151
  rspec
129
152
  rubocop
130
- simplecov
131
153
  yard (~> 0.8.0)
data/README.md CHANGED
@@ -1,10 +1,21 @@
1
- react-middleman
1
+ middleman-react [![Gem Version](https://badge.fury.io/rb/middleman-react.svg)](http://badge.fury.io/rb/middleman-react) [![Build Status](https://travis-ci.org/plasticine/middleman-react.png?branch=master)](https://travis-ci.org/plasticine/middleman-react) [![Code Climate](https://codeclimate.com/github/plasticine/middleman-react.png)](https://codeclimate.com/github/plasticine/middleman-react)
2
2
  ===============
3
3
 
4
- `gem install middleman-react`
4
+ ### Use [React] JSX transformations with [Middleman].
5
5
 
6
- Use [React] JSX transformations with [Middleman].
6
+ Inspired (and pretty much a clone of really) the [react-rails] gem for Middleman. This gem allows you to write and use `*.jsx` assets inside Middleman.
7
7
 
8
+ #### Usage
9
+ 1. `gem install middleman-react`
10
+ 2. `activate :react` in `config.rb`
8
11
 
9
- [React]: http://facebook.github.io/react/
10
- [Middleman]: http://middlemanapp.com
12
+ #### Developing / Contributing
13
+ 1. Fork it!
14
+ 2. Get set up: `./script/bootstrap`
15
+ 3. ...?
16
+ 4. Run specs: `./script/spec`
17
+ 5. Pull request!
18
+
19
+ [React]: http://facebook.github.io/react/
20
+ [Middleman]: http://middlemanapp.com
21
+ [react-rails]: https://github.com/facebook/react-rails
@@ -0,0 +1,7 @@
1
+ ###* @jsx React.DOM ###
2
+
3
+ @app.components.test = React.createClass
4
+ render: ->
5
+ `<div>
6
+ <TestComponent data={this.props.someData} />
7
+ </div>`
@@ -0,0 +1,2 @@
1
+ /** @jsx React.DOM */
2
+ <div/>;
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'middleman-core'
2
4
 
3
5
  ::Middleman::Extensions.register(:react) do
@@ -1,10 +1,12 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'middleman-core'
2
4
  require 'middleman-react/jsx'
3
5
  require 'middleman-react/jsx/template'
4
6
 
5
- # Middleman extension entry point
6
7
  module Middleman
7
8
  module React
9
+ # Middleman extension entry point
8
10
  class Extension < Middleman::Extension
9
11
  def initialize(app, options_hash = {}, &block)
10
12
  ::Tilt.register 'jsx', Middleman::React::Template
@@ -1,8 +1,11 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'execjs'
2
4
  require 'react/source'
3
5
 
4
6
  module Middleman
5
7
  module React
8
+ # Methods for invoking the JSXTransformer via ExecJS
6
9
  module JSX
7
10
  def self.context
8
11
  contents =
@@ -13,10 +16,10 @@ module Middleman
13
16
  @context ||= ExecJS.compile(contents)
14
17
  end
15
18
 
16
- def self.transform(code)
17
- result = context.call('JSXTransformer.transform', code)
18
- return result['code']
19
+ def transform(code)
20
+ context.call('JSXTransformer.transform', code)['code']
19
21
  end
22
+ module_function :transform
20
23
  end
21
24
  end
22
25
  end
@@ -1,14 +1,17 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'tilt'
2
4
 
3
5
  module Middleman
4
6
  module React
7
+ # Tilt Tempalte for handling JSX files
5
8
  class Template < Tilt::Template
6
9
  self.default_mime_type = 'application/javascript'
7
10
 
8
11
  def prepare; end
9
12
 
10
13
  def evaluate(scope, locals, &block)
11
- @output ||= JSX::transform(data)
14
+ @output ||= JSX.transform(data)
12
15
  end
13
16
  end
14
17
  end
@@ -1,6 +1,9 @@
1
+ # encoding: UTF-8
2
+
1
3
  module Middleman
4
+ # Gem packaging constants
2
5
  module React
3
6
  PACKAGE = 'middleman-react'
4
- VERSION = '0.0.2'
7
+ VERSION = '0.10.0'
5
8
  end
6
9
  end
@@ -18,16 +18,14 @@ Gem::Specification.new do |gem|
18
18
 
19
19
  gem.add_dependency "middleman-core", [">= 3.0"]
20
20
  gem.add_dependency "execjs"
21
- gem.add_dependency "react-source", "0.8.0"
21
+ gem.add_dependency "react-source", "0.10.0"
22
22
 
23
- gem.add_development_dependency "appraisal"
24
23
  gem.add_development_dependency "aruba"
25
24
  gem.add_development_dependency "cane"
26
- gem.add_development_dependency "coveralls"
27
25
  gem.add_development_dependency "cucumber"
26
+ gem.add_development_dependency "middleman", '~> 3.2'
27
+ gem.add_development_dependency "pry"
28
28
  gem.add_development_dependency "rake"
29
29
  gem.add_development_dependency "rspec"
30
30
  gem.add_development_dependency "rubocop"
31
- gem.add_development_dependency "simplecov"
32
- gem.add_development_dependency "pry"
33
31
  end
data/script/spec CHANGED
@@ -2,6 +2,5 @@
2
2
 
3
3
  bundle --binstubs --quiet
4
4
 
5
- bin/rspec
6
- bin/cucumber spec/features
7
5
  bin/rubocop lib
6
+ bin/cucumber spec/features
@@ -0,0 +1,28 @@
1
+ Feature: Transforming JSX into Javascript when it is written in Coffeescript
2
+ Background:
3
+ Given a fixture app "app"
4
+ Given a successfully built app at "app"
5
+
6
+ Scenario: A JSX file written in coffeescript
7
+ When I cd to "build"
8
+ Then the following files should exist:
9
+ | assets/javascripts/coffeescript.js |
10
+ When I run `cat assets/javascripts/coffeescript.js`
11
+ Then the stdout from "cat assets/javascripts/coffeescript.js" should contain exactly:
12
+ """
13
+
14
+ /** @jsx React.DOM */
15
+
16
+ (function() {
17
+ this.app.components.test = React.createClass({displayName: 'test',
18
+ render: function() {
19
+ return React.DOM.div(null,
20
+ TestComponent( {data:this.props.someData} )
21
+ );
22
+ }
23
+ });
24
+
25
+ }).call(this);
26
+
27
+ """
28
+ And the exit status should be 0
@@ -0,0 +1,17 @@
1
+ Feature: Transforming JSX into Javascript
2
+ Background:
3
+ Given a fixture app "app"
4
+ Given a successfully built app at "app"
5
+
6
+ Scenario: A simple JSX file
7
+ When I cd to "build"
8
+ Then the following files should exist:
9
+ | assets/javascripts/plain_jsx.js |
10
+ When I run `cat assets/javascripts/plain_jsx.js`
11
+ Then the stdout from "cat assets/javascripts/plain_jsx.js" should contain exactly:
12
+ """
13
+ /** @jsx React.DOM */
14
+ React.DOM.div(null);
15
+
16
+ """
17
+ And the exit status should be 0
@@ -1,9 +1,7 @@
1
1
  ENV["TEST"] = "true"
2
- ENV["AUTOLOAD_SPROCKETS"] = "false"
3
2
 
4
- PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
3
+ PROJECT_ROOT_PATH = File.join(File.dirname(__FILE__), '../../../')
5
4
 
6
5
  require "middleman-core"
7
6
  require "middleman-core/step_definitions"
8
-
9
- # require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-react')
7
+ require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-react')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-react
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Morris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-07 00:00:00.000000000 Z
11
+ date: 2014-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman-core
@@ -44,28 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.8.0
47
+ version: 0.10.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.8.0
55
- - !ruby/object:Gem::Dependency
56
- name: appraisal
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - '>='
67
- - !ruby/object:Gem::Version
68
- version: '0'
54
+ version: 0.10.0
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: aruba
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -94,20 +80,6 @@ dependencies:
94
80
  - - '>='
95
81
  - !ruby/object:Gem::Version
96
82
  version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: coveralls
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'
111
83
  - !ruby/object:Gem::Dependency
112
84
  name: cucumber
113
85
  requirement: !ruby/object:Gem::Requirement
@@ -123,21 +95,21 @@ dependencies:
123
95
  - !ruby/object:Gem::Version
124
96
  version: '0'
125
97
  - !ruby/object:Gem::Dependency
126
- name: rake
98
+ name: middleman
127
99
  requirement: !ruby/object:Gem::Requirement
128
100
  requirements:
129
- - - '>='
101
+ - - ~>
130
102
  - !ruby/object:Gem::Version
131
- version: '0'
103
+ version: '3.2'
132
104
  type: :development
133
105
  prerelease: false
134
106
  version_requirements: !ruby/object:Gem::Requirement
135
107
  requirements:
136
- - - '>='
108
+ - - ~>
137
109
  - !ruby/object:Gem::Version
138
- version: '0'
110
+ version: '3.2'
139
111
  - !ruby/object:Gem::Dependency
140
- name: rspec
112
+ name: pry
141
113
  requirement: !ruby/object:Gem::Requirement
142
114
  requirements:
143
115
  - - '>='
@@ -151,7 +123,7 @@ dependencies:
151
123
  - !ruby/object:Gem::Version
152
124
  version: '0'
153
125
  - !ruby/object:Gem::Dependency
154
- name: rubocop
126
+ name: rake
155
127
  requirement: !ruby/object:Gem::Requirement
156
128
  requirements:
157
129
  - - '>='
@@ -165,7 +137,7 @@ dependencies:
165
137
  - !ruby/object:Gem::Version
166
138
  version: '0'
167
139
  - !ruby/object:Gem::Dependency
168
- name: simplecov
140
+ name: rspec
169
141
  requirement: !ruby/object:Gem::Requirement
170
142
  requirements:
171
143
  - - '>='
@@ -179,7 +151,7 @@ dependencies:
179
151
  - !ruby/object:Gem::Version
180
152
  version: '0'
181
153
  - !ruby/object:Gem::Dependency
182
- name: pry
154
+ name: rubocop
183
155
  requirement: !ruby/object:Gem::Requirement
184
156
  requirements:
185
157
  - - '>='
@@ -199,16 +171,15 @@ executables: []
199
171
  extensions: []
200
172
  extra_rdoc_files: []
201
173
  files:
202
- - .cane
203
174
  - .gitignore
204
- - .rspec
205
- - Appraisals
175
+ - .travis.yml
206
176
  - Gemfile
207
177
  - Gemfile.lock
208
178
  - LICENSE
209
179
  - README.md
210
- - Rakefile
211
180
  - fixtures/app/config.rb
181
+ - fixtures/app/source/assets/javascripts/coffeescript.js.jsx.coffee
182
+ - fixtures/app/source/assets/javascripts/plain_jsx.js.jsx
212
183
  - lib/middleman-react.rb
213
184
  - lib/middleman-react/extension.rb
214
185
  - lib/middleman-react/jsx.rb
@@ -217,11 +188,9 @@ files:
217
188
  - middleman-react.gemspec
218
189
  - script/bootstrap
219
190
  - script/spec
191
+ - spec/features/coffeescript.feature
192
+ - spec/features/jsx.feature
220
193
  - spec/features/support/env.rb
221
- - spec/spec_helper.rb
222
- - spec/use_coveralls.rb
223
- - spec/use_simplecov.rb
224
- - travis.yml
225
194
  homepage: https://github.com/plasticine/middleman-react
226
195
  licenses:
227
196
  - MIT
@@ -242,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
242
211
  version: '0'
243
212
  requirements: []
244
213
  rubyforge_project:
245
- rubygems_version: 2.1.11
214
+ rubygems_version: 2.2.2
246
215
  signing_key:
247
216
  specification_version: 4
248
217
  summary: Ruby gem for automatically transforming JSX and using React in Middleman.
data/.cane DELETED
@@ -1,4 +0,0 @@
1
- --abc-max 10
2
- --gte coverage/covered_percent,100
3
- --no-style
4
- --color
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --format progress
data/Appraisals DELETED
@@ -1,16 +0,0 @@
1
- appraise "middleman-3.0" do
2
- gem 'middleman', '~> 3.0'
3
- end
4
-
5
- appraise "middleman-3.1" do
6
- gem 'middleman', '~> 3.1'
7
- end
8
-
9
- appraise "middleman-3.2" do
10
- gem 'middleman', '~> 3.2'
11
- end
12
-
13
- appraise "middleman-3.2-therubyracer" do
14
- gem 'middleman', '~> 3.2'
15
- gem 'therubyracer', '0.12.0', :platform => :mri
16
- end
data/Rakefile DELETED
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env rake
2
-
3
- require 'rubygems'
4
- require 'bundler/setup'
5
- require 'bundler'
6
-
7
- Bundler::GemHelper.install_tasks
8
-
9
- require 'appraisal'
10
- require 'rake/clean'
11
- require 'rspec/core/rake_task'
12
-
13
- namespace :spec do
14
- begin
15
- require 'cane/rake_task'
16
- desc "Run cane to check quality metrics"
17
- Cane::RakeTask.new(:quality) do |cane|
18
- cane.abc_max = 10
19
- cane.add_threshold 'coverage/covered_percent', :>=, 74
20
- cane.no_style = true
21
- end
22
-
23
- task :default => :quality
24
- rescue LoadError
25
- warn "cane not available, quality task not provided."
26
- end
27
-
28
- desc 'Run unit specs'
29
- RSpec::Core::RakeTask.new(:unit) do |spec|
30
- spec.pattern = "spec/unit/*_spec.rb"
31
- spec.rspec_opts = "--require spec_helper"
32
- end
33
- end
34
-
35
- desc 'Default: run unit tests.'
36
- task :default => ['spec:unit']
data/spec/spec_helper.rb DELETED
@@ -1,11 +0,0 @@
1
- if ENV['COVERAGE']
2
- require_relative 'use_coveralls' if ENV['TRAVIS']
3
- require_relative 'use_simplecov'
4
- end
5
-
6
- RSpec.configure do |config|
7
- config.treat_symbols_as_metadata_keys_with_true_values = true
8
- config.run_all_when_everything_filtered = true
9
- config.filter_run :focus
10
- config.order = 'random'
11
- end
@@ -1,2 +0,0 @@
1
- require 'coveralls'
2
- Coveralls.wear!
@@ -1,15 +0,0 @@
1
- puts "[Simplecov] enabled"
2
- require 'simplecov'
3
-
4
- class SimpleCov::Formatter::QualityFormatter
5
- def format(result)
6
- SimpleCov::Formatter::HTMLFormatter.new.format(result)
7
- File.open("coverage/covered_percent", "w") do |f|
8
- f.puts result.source_files.covered_percent.to_f
9
- end
10
- end
11
- end
12
-
13
- SimpleCov.formatter = SimpleCov::Formatter::QualityFormatter
14
-
15
- SimpleCov.start 'rails'
data/travis.yml DELETED
@@ -1,16 +0,0 @@
1
- language: ruby
2
- bundler_args: --binstubs
3
- rvm:
4
- - 2.1.0
5
- - 2.0.0
6
- - 1.9.3
7
- script:
8
- - script/spec
9
- gemfile:
10
- - gemfiles/middleman-3.0.gemfile
11
- - gemfiles/middleman-3.1.gemfile
12
- - gemfiles/middleman-3.2.gemfile
13
- matrix:
14
- include:
15
- - rvm: 2.0.0
16
- env: COVERAGE=true