zip_dsl 1.0.1 → 1.0.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/.idea/workspace.xml CHANGED
@@ -2,17 +2,7 @@
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="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/zip_dsl.rb" />
6
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/zip_dsl.iml" afterPath="$PROJECT_DIR$/.idea/zip_dsl.iml" />
7
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/misc.xml" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
8
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
9
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Gemfile" afterPath="$PROJECT_DIR$/Gemfile" />
10
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/directory_builder.rb" afterPath="$PROJECT_DIR$/lib/directory_builder.rb" />
11
5
  <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/zip_dsl/version.rb" afterPath="$PROJECT_DIR$/lib/zip_dsl/version.rb" />
12
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/zip_dsl/zip_dsl.rb" afterPath="$PROJECT_DIR$/lib/zip_dsl/zip_dsl.rb" />
13
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/zip_dsl/zip_writer.rb" afterPath="$PROJECT_DIR$/lib/zip_dsl/zip_writer.rb" />
14
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/spec/zip_builder_spec.rb" afterPath="$PROJECT_DIR$/spec/zip_builder_spec.rb" />
15
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/zip_dsl.gemspec" afterPath="$PROJECT_DIR$/zip_dsl.gemspec" />
16
6
  </list>
17
7
  <ignored path="zip_dsl.iws" />
18
8
  <ignored path=".idea/workspace.xml" />
@@ -34,10 +24,10 @@
34
24
  </component>
35
25
  <component name="FileEditorManager">
36
26
  <leaf>
37
- <file leaf-file-name="zip_builder_spec.rb" pinned="false" current="false" current-in-tab="false">
38
- <entry file="file://$PROJECT_DIR$/spec/zip_builder_spec.rb">
27
+ <file leaf-file-name="zip_writer.rb" pinned="false" current="false" current-in-tab="false">
28
+ <entry file="file://$PROJECT_DIR$/lib/zip_dsl/zip_writer.rb">
39
29
  <provider selected="true" editor-type-id="text-editor">
40
- <state line="73" column="70" selection-start="2060" selection-end="2060" vertical-scroll-proportion="0.0">
30
+ <state line="19" column="25" selection-start="480" selection-end="480" vertical-scroll-proportion="0.0">
41
31
  <folding />
42
32
  </state>
43
33
  </provider>
@@ -52,10 +42,10 @@
52
42
  </provider>
53
43
  </entry>
54
44
  </file>
55
- <file leaf-file-name="zip_writer.rb" pinned="false" current="false" current-in-tab="false">
56
- <entry file="file://$PROJECT_DIR$/lib/zip_dsl/zip_writer.rb">
45
+ <file leaf-file-name="zip_dsl.rb" pinned="false" current="false" current-in-tab="false">
46
+ <entry file="file://$PROJECT_DIR$/lib/zip_dsl/zip_dsl.rb">
57
47
  <provider selected="true" editor-type-id="text-editor">
58
- <state line="56" column="13" selection-start="1261" selection-end="1261" vertical-scroll-proportion="0.0">
48
+ <state line="7" column="32" selection-start="125" selection-end="142" vertical-scroll-proportion="0.0">
59
49
  <folding />
60
50
  </state>
61
51
  </provider>
@@ -91,8 +81,8 @@
91
81
  <option value="$PROJECT_DIR$/lib/directory_builder.rb" />
92
82
  <option value="$PROJECT_DIR$/spec/spec_helper.rb" />
93
83
  <option value="$PROJECT_DIR$/lib/zip_dsl/zip_dsl.rb" />
94
- <option value="$PROJECT_DIR$/lib/zip_dsl/zip_writer.rb" />
95
84
  <option value="$PROJECT_DIR$/spec/zip_builder_spec.rb" />
85
+ <option value="$PROJECT_DIR$/lib/zip_dsl/zip_writer.rb" />
96
86
  <option value="$PROJECT_DIR$/lib/zip_dsl/version.rb" />
97
87
  </list>
98
88
  </option>
@@ -583,30 +573,30 @@
583
573
  </state>
584
574
  </provider>
585
575
  </entry>
586
- <entry file="file://$PROJECT_DIR$/lib/zip_dsl/zip_dsl.rb">
576
+ <entry file="file://$PROJECT_DIR$/lib/zip_dsl/zip_reader.rb">
587
577
  <provider selected="true" editor-type-id="text-editor">
588
- <state line="20" column="0" selection-start="446" selection-end="446" vertical-scroll-proportion="0.51863855">
578
+ <state line="6" column="0" selection-start="81" selection-end="81" vertical-scroll-proportion="0.0">
589
579
  <folding />
590
580
  </state>
591
581
  </provider>
592
582
  </entry>
593
- <entry file="file://$PROJECT_DIR$/lib/zip_dsl/zip_reader.rb">
583
+ <entry file="file://$PROJECT_DIR$/spec/zip_builder_spec.rb">
594
584
  <provider selected="true" editor-type-id="text-editor">
595
- <state line="6" column="0" selection-start="81" selection-end="81" vertical-scroll-proportion="0.0">
585
+ <state line="73" column="70" selection-start="2060" selection-end="2060" vertical-scroll-proportion="0.76661265">
596
586
  <folding />
597
587
  </state>
598
588
  </provider>
599
589
  </entry>
600
- <entry file="file://$PROJECT_DIR$/lib/zip_dsl/zip_writer.rb">
590
+ <entry file="file://$PROJECT_DIR$/lib/zip_dsl/zip_dsl.rb">
601
591
  <provider selected="true" editor-type-id="text-editor">
602
- <state line="56" column="13" selection-start="1261" selection-end="1261" vertical-scroll-proportion="0.0">
592
+ <state line="7" column="32" selection-start="125" selection-end="142" vertical-scroll-proportion="0.0">
603
593
  <folding />
604
594
  </state>
605
595
  </provider>
606
596
  </entry>
607
- <entry file="file://$PROJECT_DIR$/spec/zip_builder_spec.rb">
597
+ <entry file="file://$PROJECT_DIR$/lib/zip_dsl/zip_writer.rb">
608
598
  <provider selected="true" editor-type-id="text-editor">
609
- <state line="73" column="70" selection-start="2060" selection-end="2060" vertical-scroll-proportion="0.0">
599
+ <state line="19" column="25" selection-start="480" selection-end="480" vertical-scroll-proportion="0.0">
610
600
  <folding />
611
601
  </state>
612
602
  </provider>
@@ -1,3 +1,3 @@
1
1
  module ZipDSL
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -15,8 +15,9 @@ 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]}"
18
19
 
19
- add_file "#@basedir/#{params[:name]}", to_dir
20
+ add_file name, to_dir
20
21
  end
21
22
 
22
23
  def content params
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.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: