guard-middleman 0.4.0 → 0.5.0

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: a96a118df441a42ab09f950b5026f6c53c32329e
4
- data.tar.gz: 51c7b87e5ca00e0b24f091faf11c2b06f9945f83
3
+ metadata.gz: e3211eb459a75f3d6ee11304bd519907ba1e432d
4
+ data.tar.gz: fdd6f87641b1144c58ee8170329a7f3e5a54ec89
5
5
  SHA512:
6
- metadata.gz: 6769ccd18799c346f811aee3695d507cb909cbb067d9feff1c50e400f6c7487c02daa9eac404570d9d8ac204f0456cf68375aaa6b222df9a34a26bf05b6d95e9
7
- data.tar.gz: b13fb9a6cd93e5ae85c23df6874c4e1fcafbde6d326ed7cb0c61ef4c1ebda78bb415ad0d85b0332506798973192f1771de476c678205cd81c48b306f6947b26e
6
+ metadata.gz: 4bed538c8b7dba36e4c26ffbbe6e843111a802ef4079437f7fe28f4256e7629d80a09ad9edda767cb7a5210cf64ec54a88257ae210d70ab71cdd4ffe66113501
7
+ data.tar.gz: 760cec8ecc23f4aae02daf388bc3104a36ee7beeda5646c2bb6330f6bf76976e8fbd3eea0dfb9a0a2112f8366bce5eb3d8029ab96cb3903b123c789ca751ea52
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/Gemfile CHANGED
@@ -2,3 +2,11 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in guard-middleman.gemspec
4
4
  gemspec
5
+
6
+ group :build do
7
+ gem 'rake'
8
+ end
9
+
10
+ group :test do
11
+ gem 'rspec', '~> 3.1'
12
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2011 Matthias Döring
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile CHANGED
@@ -1,2 +1,10 @@
1
- require 'bundler'
2
- Bundler::GemHelper.install_tasks
1
+ require 'bundler/gem_tasks'
2
+
3
+ default_tasks = []
4
+
5
+ require "rspec/core/rake_task"
6
+ default_tasks << RSpec::Core::RakeTask.new(:spec) do |t|
7
+ t.verbose = (ENV['CI'] == 'true')
8
+ end
9
+
10
+ task default: default_tasks.map(&:name)
@@ -11,10 +11,10 @@ Gem::Specification.new do |s|
11
11
  s.homepage = "http://rubygems.org/gems/guard-middleman"
12
12
  s.summary = %q{Guard gem for Middleman}
13
13
  s.description = %q{Guard gem for Middleman - automatically runs middleman build}
14
-
15
- s.rubyforge_project = "guard-middleman"
14
+ s.license = "MIT"
16
15
 
17
16
  s.add_dependency 'guard', '>= 1.4.0'
17
+ s.add_dependency 'guard-compat', '~> 1.1'
18
18
  s.add_dependency 'middleman', '>= 3.0.0'
19
19
 
20
20
  s.files = `git ls-files`.split("\n")
@@ -1,10 +1,10 @@
1
- require 'guard'
2
- require 'guard/guard'
1
+ require 'thor'
2
+ require 'guard/compat/plugin'
3
3
 
4
4
  module Guard
5
- class Middleman < Guard
5
+ class Middleman < Plugin
6
6
 
7
- def initialize(watchers=[], options={})
7
+ def initialize(options={})
8
8
  super
9
9
  # init stuff here, thx!
10
10
  @options = Thor::CoreExt::HashWithIndifferentAccess.new(
@@ -27,7 +27,7 @@ module Guard
27
27
  # Please override initialize method to init stuff
28
28
  def start
29
29
  if @options[:run_on_start]
30
- system(build_command)
30
+ Kernel.system(build_command)
31
31
  end
32
32
  true
33
33
  end
@@ -46,7 +46,7 @@ module Guard
46
46
  # Called on Ctrl-\ signal
47
47
  # This method should be principally used for long action like running all specs/tests/...
48
48
  def run_all
49
- system(build_command)
49
+ Kernel.system(build_command)
50
50
  end
51
51
 
52
52
  # Called on file(s) modifications
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module MiddlemanVersion
3
- VERSION = "0.4.0"
3
+ VERSION = "0.5.0"
4
4
  end
5
5
  end
@@ -0,0 +1,47 @@
1
+ require "guard/compat/test/helper"
2
+
3
+ require "guard/middleman"
4
+
5
+ RSpec.describe Guard::Middleman do
6
+ let(:options) { {} }
7
+ subject { described_class.new(options) }
8
+
9
+ describe '#start' do
10
+ context "without run_on_start option" do
11
+ it "does not build" do
12
+ expect(Kernel).to_not receive(:system)
13
+ subject.start
14
+ end
15
+ end
16
+
17
+ context "with run_on_start set to true" do
18
+ let(:options) { {run_on_start: true} }
19
+ it "builds" do
20
+ expect(Kernel).to receive(:system).with("bundle exec middleman build")
21
+ subject.start
22
+ end
23
+ end
24
+
25
+ context "with run_on_start set to false" do
26
+ let(:options) { {run_on_start: false} }
27
+ it "does not build" do
28
+ expect(Kernel).to_not receive(:system)
29
+ subject.start
30
+ end
31
+ end
32
+ end
33
+
34
+ describe '#run_all' do
35
+ it "builds" do
36
+ expect(Kernel).to receive(:system).with("bundle exec middleman build")
37
+ subject.run_all
38
+ end
39
+ end
40
+
41
+ describe '#run_on_change' do
42
+ it "builds" do
43
+ expect(Kernel).to receive(:system).with("bundle exec middleman build")
44
+ subject.run_all
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,24 @@
1
+ RSpec.configure do |config|
2
+ config.expect_with :rspec do |expectations|
3
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
4
+ end
5
+
6
+ config.mock_with :rspec do |mocks|
7
+ mocks.verify_partial_doubles = true
8
+ end
9
+
10
+ config.filter_run :focus
11
+ config.run_all_when_everything_filtered = true
12
+
13
+ config.disable_monkey_patching!
14
+
15
+ # config.warnings = true
16
+
17
+ config.default_formatter = 'doc' if config.files_to_run.one?
18
+
19
+ #config.profile_examples = 10
20
+
21
+ config.order = :random
22
+
23
+ Kernel.srand config.seed
24
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-middleman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthias Döring
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-26 00:00:00.000000000 Z
11
+ date: 2014-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.4.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: guard-compat
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.1'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: middleman
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -46,15 +60,20 @@ extensions: []
46
60
  extra_rdoc_files: []
47
61
  files:
48
62
  - ".gitignore"
63
+ - ".rspec"
49
64
  - Gemfile
65
+ - LICENSE.txt
50
66
  - README.md
51
67
  - Rakefile
52
68
  - guard-middleman.gemspec
53
69
  - lib/guard/middleman.rb
54
70
  - lib/guard/middleman/templates/Guardfile
55
71
  - lib/guard/middleman/version.rb
72
+ - spec/lib/guard/middleman_spec.rb
73
+ - spec/spec_helper.rb
56
74
  homepage: http://rubygems.org/gems/guard-middleman
57
- licenses: []
75
+ licenses:
76
+ - MIT
58
77
  metadata: {}
59
78
  post_install_message:
60
79
  rdoc_options: []
@@ -71,9 +90,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
90
  - !ruby/object:Gem::Version
72
91
  version: '0'
73
92
  requirements: []
74
- rubyforge_project: guard-middleman
93
+ rubyforge_project:
75
94
  rubygems_version: 2.2.2
76
95
  signing_key:
77
96
  specification_version: 4
78
97
  summary: Guard gem for Middleman
79
- test_files: []
98
+ test_files:
99
+ - spec/lib/guard/middleman_spec.rb
100
+ - spec/spec_helper.rb