middleman-remover 1.0.0 → 1.0.1

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: 64796027fb9070fcaa5e09932f04704f0257b97d
4
- data.tar.gz: e24f33b02b4d3c725a59a55291190dd522966956
3
+ metadata.gz: 66a64172f2f524a42b4c5efb36e474f37766d9b2
4
+ data.tar.gz: 451147ebfdff7ed32511e21093840128b6da11d6
5
5
  SHA512:
6
- metadata.gz: 29a70fd5f3cdbdb29f2853c96e954be6b8502d49d4d02cb7cdf64d6b88232a877f2cf49d8b91ac58ccbcafb8f075a1e356dc284c2b67037e202403500b2ff7e6
7
- data.tar.gz: b93d0df325d43677366b03987c6400ece9097738b6d9172867779b094674891ca748c2f34700d161f476e963cef4aa2d9628997244dd18b82878271162d35a9e
6
+ metadata.gz: 7a5478c9023b33009503443e582091986ff3fa1a88aca5c4976474640c3304488293ea7c171b9eb0677e25b71092d89a75a51b030813e73c9146a139baa2ba65
7
+ data.tar.gz: 0a58789e73ce8aa8e0b354ecf568d014ff6865b7bfed85b0a829b7950337ae49ff69c0372d7b9df3ae31e71528caaecab487d1e74fb8ca65b209281b4692576c
data/.travis.yml CHANGED
@@ -1,14 +1,19 @@
1
1
  language: ruby
2
- script: "bundle exec cucumber"
2
+ script: bundle exec cucumber
3
3
  rvm:
4
- - 1.9.3
5
- - 2.0.0
6
- - 2.1.2
7
- - jruby-19mode
4
+ - ruby-head
5
+ - jruby-head
6
+ - jruby-19mode
7
+ - 2.2
8
+ - 2.1
9
+ - 2.0
10
+ - 1.9.3
11
+ os:
12
+ - linux
13
+ - osx
8
14
  env: TEST=true TRAVIS=true
9
15
  gemfile:
10
- - Gemfile
16
+ - Gemfile
11
17
  notifications:
12
- webhooks:
13
- - https://idobata.io/hook/travis_ci/d75034d3-11f7-4e03-9abc-8d84f783a855
14
-
18
+ slack:
19
+ secure: jEYk3mSCnUEK3xoU42RrqSxim4zWQYtyTKd54A8GbN05woayc0HeSx1YAFxwR/B4w4A/w2EzAFXXZzGDy3uvoQGGEHIkj3IVcGcZGre9G2LuvIozKfxq6Erg696VkwAJ58aM3WVOxhWxDrRCF4y5NHyrn2IGtmPcK4R4iEn8RHQ=
@@ -29,8 +29,27 @@ Feature: Middleman-Remover
29
29
  And a successfully built app at "basic-app"
30
30
  When I cd to "build"
31
31
  Then a file named "empty" should not exist
32
- And the output should contain "middleman-remover:"
33
- And the output should contain "is removed"
32
+ And the output should contain "== middleman-remover:"
33
+ And the output should contain "is removed =="
34
+
35
+ Scenario: Removed Message using block
36
+ Given a fixture app "basic-app"
37
+ And a file named "config.rb" with:
38
+ """
39
+ configure :build do
40
+ activate :remover do |r|
41
+ r.paths = %w(empty)
42
+ end
43
+ end
44
+ """
45
+ And a file named "source/empty" with:
46
+ """
47
+ """
48
+ And a successfully built app at "basic-app"
49
+ When I cd to "build"
50
+ Then a file named "empty" should not exist
51
+ And the output should contain "== middleman-remover:"
52
+ And the output should contain "is removed =="
34
53
 
35
54
  Scenario: File not exist Message
36
55
  Given a fixture app "basic-app"
@@ -42,8 +61,8 @@ Feature: Middleman-Remover
42
61
  """
43
62
  And a successfully built app at "basic-app"
44
63
  When I cd to "build"
45
- Then the output should contain "middleman-remover:"
46
- And the output should contain "is not exist"
64
+ Then the output should contain "== middleman-remover:"
65
+ And the output should contain "is not exist =="
47
66
 
48
67
  Scenario: Directory not exist Message
49
68
  Given a fixture app "basic-app"
@@ -55,8 +74,8 @@ Feature: Middleman-Remover
55
74
  """
56
75
  And a successfully built app at "basic-app"
57
76
  When I cd to "build"
58
- Then the output should contain "middleman-remover:"
59
- And the output should contain "is not exist"
77
+ Then the output should contain "== middleman-remover:"
78
+ And the output should contain "is not exist =="
60
79
 
61
80
  Scenario: Remove file
62
81
  Given a fixture app "basic-app"
@@ -2,35 +2,34 @@ require 'fileutils'
2
2
 
3
3
  module Middleman
4
4
  module Remover
5
+ # Middleman Remover Extension
5
6
  class Extension < ::Middleman::Extension
6
7
  option :paths, [], 'List of remove files/directories paths'
7
8
 
8
9
  def initialize(app, options_hash = {}, &block)
9
10
  super
10
-
11
11
  paths = options.paths
12
12
  build_dir = app.build_dir
13
- ext = self
13
+ extension = self
14
14
 
15
15
  app.after_build do
16
- ext.remove(paths, build_dir)
16
+ extension.remove(paths, build_dir)
17
17
  end
18
18
  end
19
19
 
20
20
  def remove(paths, dir)
21
21
  paths.each do |path|
22
- path = File.join(dir, path)
23
- list = Dir.glob(path)
22
+ full_path = File.join(dir, path)
23
+ files = Dir.glob(full_path)
24
24
 
25
- if list.length > 0
26
- FileUtils.rm_rf(list)
27
- puts " middleman-remover: #{path} is removed"
25
+ if files.length > 0
26
+ FileUtils.rm_rf(files)
27
+ app.logger.info "== middleman-remover: #{path} is removed =="
28
28
  else
29
- puts " middleman-remover: #{path} is not exist"
29
+ app.logger.info "== middleman-remover: #{path} is not exist =="
30
30
  end
31
31
  end
32
32
  end
33
33
  end
34
34
  end
35
35
  end
36
-
@@ -1,5 +1,6 @@
1
1
  module Middleman
2
+ # Middleman Remover Module
2
3
  module Remover
3
- VERSION = "1.0.0"
4
+ VERSION = '1.0.1'
4
5
  end
5
6
  end
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
  spec.required_ruby_version = '>=1.9.3'
21
21
 
22
- spec.add_runtime_dependency "middleman", "~>3.3"
22
+ spec.add_runtime_dependency "middleman", "~> 3.3"
23
23
 
24
24
  spec.add_development_dependency "cucumber", "~> 1.3"
25
25
  spec.add_development_dependency "aruba", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-remover
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - yterajima
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-12 00:00:00.000000000 Z
11
+ date: 2015-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  version: '0'
124
124
  requirements: []
125
125
  rubyforge_project:
126
- rubygems_version: 2.2.2
126
+ rubygems_version: 2.4.5
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Remove some files from build dir.