html_mockup 0.7.1 → 0.7.2

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.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## Version 0.7.2
4
+ * Add zip finalizers
5
+ * Instead of complaining about existing build path, just clean it up
6
+ * Instead of complaining about unexisting target path, just create it
7
+ * Automatically require all built-in procssors
8
+
3
9
  ## Version 0.7.1
4
10
  * Pass target_file to the ERBTemplate to files with erb errors
5
11
  * Fix env["MOCKUP_PROJECT"] setting in extractor
data/html_mockup.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "html_mockup"
5
- s.version = "0.7.1"
5
+ s.version = "0.7.2"
6
6
 
7
7
  s.authors = ["Flurin Egger", "Edwin van der Graaf"]
8
8
  s.email = ["info@digitpaint.nl", "flurin@digitpaint.nl"]
@@ -1,5 +1,42 @@
1
1
  module HtmlMockup::Release::Finalizers
2
+
2
3
  class Zip < Base
3
- # :-(
4
+
5
+ attr_reader :release
6
+
7
+ # @option options :prefix Prefix to put before the version (default = "html")
8
+ # @option options :zip The zip command
9
+ def call(release, options = {})
10
+ if options
11
+ options = @options.dup.update(options)
12
+ else
13
+ options = @options
14
+ end
15
+
16
+ options = {
17
+ :zip => "zip",
18
+ :prefix => "html"
19
+ }.update(options)
20
+
21
+ name = [options[:prefix], release.scm.version].join("-") + ".zip"
22
+ release.log(self, "Finalizing release to #{release.target_path + name}")
23
+
24
+ if File.exist?(release.target_path + name)
25
+ release.log(self, "Removing existing target #{release.target_path + name}")
26
+ FileUtils.rm_rf(release.target_path + name)
27
+ end
28
+
29
+ begin
30
+ `#{options[:zip]} -v`
31
+ rescue Errno::ENOENT
32
+ raise RuntimeError, "Could not find zip in #{options[:zip].inspect}"
33
+ end
34
+
35
+ ::Dir.chdir(release.build_path) do
36
+ `zip -r -9 "#{release.target_path + name}" ./*`
37
+ end
38
+ end
39
+
40
+
4
41
  end
5
42
  end
@@ -13,6 +13,7 @@ module HtmlMockup::Release::Processors
13
13
  end
14
14
  end
15
15
 
16
- require File.dirname(__FILE__) + "/finalizers/zip"
17
- require File.dirname(__FILE__) + "/finalizers/dir"
16
+ require File.dirname(__FILE__) + "/processors/requirejs"
17
+ require File.dirname(__FILE__) + "/processors/sass"
18
+ require File.dirname(__FILE__) + "/processors/yuicompressor"
18
19
 
@@ -238,11 +238,15 @@ module HtmlMockup
238
238
  # ==============
239
239
 
240
240
  def validate_paths!
241
- # Make sure the build_path is empty
242
- raise ArgumentError, "Build path \"#{self.build_path}\" is not empty" if self.build_path.exist?
241
+ if self.build_path.exist?
242
+ log self, "Cleaning up previous build \"#{self.build_path}\""
243
+ rm_rf(self.build_path)
244
+ end
243
245
 
244
- # Make sure the target_path exists
245
- raise ArgumentError, "Target path \"#{self.target_path}\" does not exist" if !self.target_path.exist?
246
+ if !self.target_path.exist?
247
+ log self, "Creating target path \"#{self.target_path}\""
248
+ mkdir self.target_path
249
+ end
246
250
  end
247
251
 
248
252
  def run_extractor!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html_mockup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-01-22 00:00:00.000000000 Z
13
+ date: 2013-02-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
17
- requirement: &70340987175420 !ruby/object:Gem::Requirement
17
+ requirement: &70143904951280 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 0.16.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70340987175420
25
+ version_requirements: *70143904951280
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rack
28
- requirement: &70340987174940 !ruby/object:Gem::Requirement
28
+ requirement: &70143904943300 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 1.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70340987174940
36
+ version_requirements: *70143904943300
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: tilt
39
- requirement: &70340986945660 !ruby/object:Gem::Requirement
39
+ requirement: &70143904942120 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0'
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *70340986945660
47
+ version_requirements: *70143904942120
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: hpricot
50
- requirement: &70340998865640 !ruby/object:Gem::Requirement
50
+ requirement: &70143904941420 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,7 +55,7 @@ dependencies:
55
55
  version: 0.6.4
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *70340998865640
58
+ version_requirements: *70143904941420
59
59
  description:
60
60
  email:
61
61
  - info@digitpaint.nl