zip_dsl 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.idea/workspace.xml CHANGED
@@ -2,7 +2,10 @@
2
2
  <project version="4">
3
3
  <component name="ChangeListManager">
4
4
  <list default="true" id="aafa5aec-b597-47d5-af91-f7b63300321f" name="Default" comment="">
5
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
5
6
  <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/zip_dsl/version.rb" afterPath="$PROJECT_DIR$/lib/zip_dsl/version.rb" />
7
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/zip_dsl/zip_writer.rb" afterPath="$PROJECT_DIR$/lib/zip_dsl/zip_writer.rb" />
8
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/zip_dsl.gemspec" afterPath="$PROJECT_DIR$/zip_dsl.gemspec" />
6
9
  </list>
7
10
  <ignored path="zip_dsl.iws" />
8
11
  <ignored path=".idea/workspace.xml" />
@@ -27,7 +30,7 @@
27
30
  <file leaf-file-name="zip_writer.rb" pinned="false" current="false" current-in-tab="false">
28
31
  <entry file="file://$PROJECT_DIR$/lib/zip_dsl/zip_writer.rb">
29
32
  <provider selected="true" editor-type-id="text-editor">
30
- <state line="19" column="25" selection-start="480" selection-end="480" vertical-scroll-proportion="0.0">
33
+ <state line="7" column="16" selection-start="144" selection-end="144" vertical-scroll-proportion="0.0">
31
34
  <folding />
32
35
  </state>
33
36
  </provider>
@@ -36,7 +39,7 @@
36
39
  <file leaf-file-name="version.rb" pinned="false" current="true" current-in-tab="true">
37
40
  <entry file="file://$PROJECT_DIR$/lib/zip_dsl/version.rb">
38
41
  <provider selected="true" editor-type-id="text-editor">
39
- <state line="1" column="18" selection-start="32" selection-end="32" vertical-scroll-proportion="0.025931928">
42
+ <state line="3" column="23" selection-start="38" selection-end="38" vertical-scroll-proportion="0.07779579">
40
43
  <folding />
41
44
  </state>
42
45
  </provider>
@@ -83,6 +86,7 @@
83
86
  <option value="$PROJECT_DIR$/lib/zip_dsl/zip_dsl.rb" />
84
87
  <option value="$PROJECT_DIR$/spec/zip_builder_spec.rb" />
85
88
  <option value="$PROJECT_DIR$/lib/zip_dsl/zip_writer.rb" />
89
+ <option value="$PROJECT_DIR$/zip_dsl.gemspec" />
86
90
  <option value="$PROJECT_DIR$/lib/zip_dsl/version.rb" />
87
91
  </list>
88
92
  </option>
@@ -496,13 +500,6 @@
496
500
  <breakpoint-manager />
497
501
  </component>
498
502
  <component name="editorHistoryManager">
499
- <entry file="file://$PROJECT_DIR$/zip_dsl.gemspec.erb">
500
- <provider selected="true" editor-type-id="text-editor">
501
- <state line="13" column="40" selection-start="557" selection-end="557" vertical-scroll-proportion="0.0">
502
- <folding />
503
- </state>
504
- </provider>
505
- </entry>
506
503
  <entry file="file://$PROJECT_DIR$/.rvmrc">
507
504
  <provider selected="true" editor-type-id="text-editor">
508
505
  <state line="3" column="21" selection-start="78" selection-end="78" vertical-scroll-proportion="0.0">
@@ -594,16 +591,23 @@
594
591
  </state>
595
592
  </provider>
596
593
  </entry>
594
+ <entry file="file://$PROJECT_DIR$/zip_dsl.gemspec">
595
+ <provider selected="true" editor-type-id="text-editor">
596
+ <state line="13" column="27" selection-start="544" selection-end="544" vertical-scroll-proportion="0.33711508">
597
+ <folding />
598
+ </state>
599
+ </provider>
600
+ </entry>
597
601
  <entry file="file://$PROJECT_DIR$/lib/zip_dsl/zip_writer.rb">
598
602
  <provider selected="true" editor-type-id="text-editor">
599
- <state line="19" column="25" selection-start="480" selection-end="480" vertical-scroll-proportion="0.0">
603
+ <state line="7" column="16" selection-start="144" selection-end="144" vertical-scroll-proportion="0.0">
600
604
  <folding />
601
605
  </state>
602
606
  </provider>
603
607
  </entry>
604
608
  <entry file="file://$PROJECT_DIR$/lib/zip_dsl/version.rb">
605
609
  <provider selected="true" editor-type-id="text-editor">
606
- <state line="1" column="18" selection-start="32" selection-end="32" vertical-scroll-proportion="0.025931928">
610
+ <state line="3" column="23" selection-start="38" selection-end="38" vertical-scroll-proportion="0.07779579">
607
611
  <folding />
608
612
  </state>
609
613
  </provider>
@@ -1,3 +1,3 @@
1
1
  module ZipDSL
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -15,9 +15,8 @@ class Zip::Writer
15
15
 
16
16
  def file params
17
17
  to_dir = params[:to_dir].nil? ? File.dirname(params[:name]) : strip_dot(params[:to_dir])
18
- name = (File.expand_path(params[:name]) == params[:name]) ? params[:name] : "#@basedir/#{params[:name]}"
19
18
 
20
- add_file name, to_dir
19
+ add_file full_name(params[:name]), to_dir
21
20
  end
22
21
 
23
22
  def content params
@@ -52,7 +51,7 @@ class Zip::Writer
52
51
  patterns = filter.kind_of?(String) ? [filter] : filter
53
52
 
54
53
  patterns.each do |pattern|
55
- files = pattern_to_files "#@basedir/#{from_dir}", pattern
54
+ files = pattern_to_files full_name(from_dir), pattern
56
55
 
57
56
  files.each do |file_name|
58
57
  suffix = File.dirname(file_name)["#@basedir/#{from_dir}".size+1..-1]
@@ -98,4 +97,12 @@ class Zip::Writer
98
97
  name
99
98
  end
100
99
 
100
+ def full_name? name
101
+ File.expand_path(name) == name
102
+ end
103
+
104
+ def full_name name
105
+ full_name?(name) ? name : "#@basedir/#{name}"
106
+ end
107
+
101
108
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zip_dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: