furoshiki 0.1.2 → 0.2.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 +7 -0
- data/.ruby-version +1 -1
- data/furoshiki.gemspec +4 -3
- data/lib/furoshiki/shoes/swt_app.rb +8 -6
- data/lib/furoshiki/version.rb +1 -1
- data/lib/furoshiki/zip/recursive.rb +6 -6
- data/spec/shoes/configuration_spec.rb +24 -24
- data/spec/shoes/spec_helper.rb +2 -0
- data/spec/shoes/swt_app_spec.rb +14 -14
- data/spec/shoes/swt_jar_spec.rb +6 -6
- data/spec/spec_helper.rb +2 -0
- data/spec/support/shared_zip.rb +1 -1
- data/spec/zip/directory_contents_spec.rb +4 -4
- data/spec/zip/directory_spec.rb +5 -5
- metadata +39 -29
    
        checksums.yaml
    ADDED
    
    | @@ -0,0 +1,7 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            SHA1:
         | 
| 3 | 
            +
              metadata.gz: d0a17813563822aee7e3ff59e3ed2fd2751ee933
         | 
| 4 | 
            +
              data.tar.gz: eea188ad94a3bbfa03fbe232f8b6e8200dcaa85f
         | 
| 5 | 
            +
            SHA512:
         | 
| 6 | 
            +
              metadata.gz: 42e0d0a9be95baf3ff80bda2606708f8240d43726fff18dc6165841278e6b8e1aa6d1f675ccd813e5813be076c4aa3f5a8a9ee18a9141379f980002d4876b19b
         | 
| 7 | 
            +
              data.tar.gz: f48f91a79590f621aaaed9ddef6dccb6e0999f9462453345087cd64b64fb3e3ad4206e05934a0caf33761173230567e5d63ebe51de4c95d367de19a45d667da5
         | 
    
        data/.ruby-version
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            jruby-1.7. | 
| 1 | 
            +
            jruby-1.7.16
         | 
    
        data/furoshiki.gemspec
    CHANGED
    
    | @@ -16,11 +16,12 @@ Gem::Specification.new do |s| | |
| 16 16 | 
             
              s.executables   = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
         | 
| 17 17 | 
             
              s.require_paths = ["lib"]
         | 
| 18 18 |  | 
| 19 | 
            -
              s.add_dependency "warbler"
         | 
| 19 | 
            +
              s.add_dependency "warbler", '~> 1.4.4'
         | 
| 20 20 | 
             
              s.add_dependency "plist"
         | 
| 21 | 
            -
              s.add_dependency 'rubyzip', ' | 
| 21 | 
            +
              s.add_dependency 'rubyzip', '>= 1.0.0'
         | 
| 22 22 |  | 
| 23 23 | 
             
              s.add_development_dependency 'rake'
         | 
| 24 24 | 
             
              s.add_development_dependency 'rspec'
         | 
| 25 | 
            -
             | 
| 25 | 
            +
              s.add_development_dependency 'rspec-its'
         | 
| 26 | 
            +
              s.add_development_dependency 'pry'
         | 
| 26 27 | 
             
            end
         | 
| @@ -170,12 +170,14 @@ module Furoshiki | |
| 170 170 | 
             
                  def extract_template
         | 
| 171 171 | 
             
                    raise IOError, "Couldn't find app template at #{template_path}." unless template_path.size?
         | 
| 172 172 | 
             
                    extracted_app = nil
         | 
| 173 | 
            -
             | 
| 174 | 
            -
             | 
| 175 | 
            -
                       | 
| 176 | 
            -
             | 
| 177 | 
            -
             | 
| 178 | 
            -
             | 
| 173 | 
            +
             | 
| 174 | 
            +
                    ::Zip::File.open(template_path) do |zip_file|
         | 
| 175 | 
            +
                      zip_file.each do |entry|
         | 
| 176 | 
            +
                        extracted_app = template_path.join(entry.name) if Pathname.new(entry.name).extname == '.app'
         | 
| 177 | 
            +
                        p = tmp.join(entry.name)
         | 
| 178 | 
            +
                        p.dirname.mkpath
         | 
| 179 | 
            +
                        entry.extract(p)
         | 
| 180 | 
            +
                      end
         | 
| 179 181 | 
             
                    end
         | 
| 180 182 | 
             
                    mv tmp.join(extracted_app.basename.to_s), tmp_app_path
         | 
| 181 183 | 
             
                  end
         | 
    
        data/lib/furoshiki/version.rb
    CHANGED
    
    
| @@ -1,5 +1,5 @@ | |
| 1 1 | 
             
            require 'pathname'
         | 
| 2 | 
            -
            require 'zip | 
| 2 | 
            +
            require 'zip'
         | 
| 3 3 |  | 
| 4 4 | 
             
            module Furoshiki
         | 
| 5 5 | 
             
              module Zip
         | 
| @@ -15,12 +15,13 @@ module Furoshiki | |
| 15 15 | 
             
                # @example
         | 
| 16 16 | 
             
                # To zip the directory "/tmp/input" so that unarchiving
         | 
| 17 17 | 
             
                # gives you a single directory "input":
         | 
| 18 | 
            -
                # | 
| 19 | 
            -
                #    | 
| 18 | 
            +
                #
         | 
| 19 | 
            +
                #   output_file = '/tmp/out.zip'
         | 
| 20 | 
            +
                #
         | 
| 21 | 
            +
                #   zip = Furoshiki::Zip::Recursive(output_file)
         | 
| 20 22 | 
             
                #   entries = Pathname.new("/tmp/input").entries
         | 
| 21 23 | 
             
                #   zip_prefix = ''
         | 
| 22 24 | 
             
                #   disk_prefix = '/tmp'
         | 
| 23 | 
            -
                #   output_file = '/tmp/out.zip'
         | 
| 24 25 | 
             
                #   zf.write(entries, disk_prefix, zip_prefix, output_file)
         | 
| 25 26 | 
             
                class Recursive
         | 
| 26 27 | 
             
                  def initialize(output_file)
         | 
| @@ -30,9 +31,8 @@ module Furoshiki | |
| 30 31 | 
             
                  # @param [Array<Pathname>] entries the initial set of files to include
         | 
| 31 32 | 
             
                  # @param [Pathname] disk_prefix a path prefix for existing entries
         | 
| 32 33 | 
             
                  # @param [Pathname] zip_prefix a path prefix to add within archive
         | 
| 33 | 
            -
                  # @param [Pathname] output_file the location of the output archive
         | 
| 34 34 | 
             
                  def write(entries, disk_prefix, zip_prefix)
         | 
| 35 | 
            -
                    io = ::Zip:: | 
| 35 | 
            +
                    io = ::Zip::File.open(@output_file, ::Zip::File::CREATE);
         | 
| 36 36 | 
             
                    write_entries(entries, disk_prefix, zip_prefix, io)
         | 
| 37 37 | 
             
                    io.close();
         | 
| 38 38 | 
             
                  end
         | 
| @@ -15,35 +15,35 @@ describe Furoshiki::Shoes::Configuration do | |
| 15 15 | 
             
                its(:dmg) { should be_an_instance_of(Hash) }
         | 
| 16 16 | 
             
                its(:run) { should be_nil }
         | 
| 17 17 | 
             
                its(:working_dir) { should eq(Pathname.new(Dir.pwd)) }
         | 
| 18 | 
            -
                it {  | 
| 18 | 
            +
                it { is_expected.not_to be_valid } # no :run
         | 
| 19 19 |  | 
| 20 20 | 
             
                describe "#icons" do
         | 
| 21 21 | 
             
                  it 'osx is nil' do
         | 
| 22 | 
            -
                    subject.icons[:osx]. | 
| 22 | 
            +
                    expect(subject.icons[:osx]).to be_nil
         | 
| 23 23 | 
             
                  end
         | 
| 24 24 |  | 
| 25 25 | 
             
                  it 'gtk is nil' do
         | 
| 26 | 
            -
                    subject.icons[:gtk]. | 
| 26 | 
            +
                    expect(subject.icons[:gtk]).to be_nil
         | 
| 27 27 | 
             
                  end
         | 
| 28 28 |  | 
| 29 29 | 
             
                  it 'win32 is nil' do
         | 
| 30 | 
            -
                    subject.icons[:win32]. | 
| 30 | 
            +
                    expect(subject.icons[:win32]).to be_nil
         | 
| 31 31 | 
             
                  end
         | 
| 32 32 | 
             
                end
         | 
| 33 33 |  | 
| 34 34 | 
             
                describe "#dmg" do
         | 
| 35 35 | 
             
                  it "has ds_store" do
         | 
| 36 | 
            -
                    subject.dmg[:ds_store]. | 
| 36 | 
            +
                    expect(subject.dmg[:ds_store]).to eq('path/to/default/.DS_Store')
         | 
| 37 37 | 
             
                  end
         | 
| 38 38 |  | 
| 39 39 | 
             
                  it "has background" do
         | 
| 40 | 
            -
                    subject.dmg[:background]. | 
| 40 | 
            +
                    expect(subject.dmg[:background]).to eq('path/to/default/background.png')
         | 
| 41 41 | 
             
                  end
         | 
| 42 42 | 
             
                end
         | 
| 43 43 |  | 
| 44 44 | 
             
                describe "#to_hash" do
         | 
| 45 45 | 
             
                  it "round-trips" do
         | 
| 46 | 
            -
                    Furoshiki::Shoes::Configuration.new(subject.to_hash). | 
| 46 | 
            +
                    expect(Furoshiki::Shoes::Configuration.new(subject.to_hash)).to eq(subject)
         | 
| 47 47 | 
             
                  end
         | 
| 48 48 | 
             
                end
         | 
| 49 49 | 
             
              end
         | 
| @@ -63,38 +63,38 @@ describe Furoshiki::Shoes::Configuration do | |
| 63 63 | 
             
                its(:icons) { should be_an_instance_of(Hash) }
         | 
| 64 64 | 
             
                its(:dmg) { should be_an_instance_of(Hash) }
         | 
| 65 65 | 
             
                its(:working_dir) { should eq(@config_filename.dirname) }
         | 
| 66 | 
            -
                it {  | 
| 66 | 
            +
                it { is_expected.to be_valid }
         | 
| 67 67 |  | 
| 68 68 | 
             
                describe "#icons" do
         | 
| 69 69 | 
             
                  it 'has osx' do
         | 
| 70 | 
            -
                    subject.icons[:osx]. | 
| 70 | 
            +
                    expect(subject.icons[:osx]).to eq('img/boots.icns')
         | 
| 71 71 | 
             
                  end
         | 
| 72 72 |  | 
| 73 73 | 
             
                  it 'has gtk' do
         | 
| 74 | 
            -
                    subject.icons[:gtk]. | 
| 74 | 
            +
                    expect(subject.icons[:gtk]).to eq('img/boots_512x512x32.png')
         | 
| 75 75 | 
             
                  end
         | 
| 76 76 |  | 
| 77 77 | 
             
                  it 'has win32' do
         | 
| 78 | 
            -
                    subject.icons[:win32]. | 
| 78 | 
            +
                    expect(subject.icons[:win32]).to eq('img/boots.ico')
         | 
| 79 79 | 
             
                  end
         | 
| 80 80 | 
             
                end
         | 
| 81 81 |  | 
| 82 82 | 
             
                describe "#dmg" do
         | 
| 83 83 | 
             
                  it "has ds_store" do
         | 
| 84 | 
            -
                    subject.dmg[:ds_store]. | 
| 84 | 
            +
                    expect(subject.dmg[:ds_store]).to eq('path/to/custom/.DS_Store')
         | 
| 85 85 | 
             
                  end
         | 
| 86 86 |  | 
| 87 87 | 
             
                  it "has background" do
         | 
| 88 | 
            -
                    subject.dmg[:background]. | 
| 88 | 
            +
                    expect(subject.dmg[:background]).to eq('path/to/custom/background.png')
         | 
| 89 89 | 
             
                  end
         | 
| 90 90 | 
             
                end
         | 
| 91 91 |  | 
| 92 92 | 
             
                it "incorporates custom features" do
         | 
| 93 | 
            -
                  subject.custom. | 
| 93 | 
            +
                  expect(subject.custom).to eq('my custom feature')
         | 
| 94 94 | 
             
                end
         | 
| 95 95 |  | 
| 96 96 | 
             
                it "round-trips" do
         | 
| 97 | 
            -
                  Furoshiki::Shoes::Configuration.new(subject.to_hash). | 
| 97 | 
            +
                  expect(Furoshiki::Shoes::Configuration.new(subject.to_hash)).to eq(subject)
         | 
| 98 98 | 
             
                end
         | 
| 99 99 | 
             
              end
         | 
| 100 100 |  | 
| @@ -110,7 +110,7 @@ describe Furoshiki::Shoes::Configuration do | |
| 110 110 | 
             
                let(:options) { {:run => "path/to/non-existent/file"} }
         | 
| 111 111 | 
             
                subject { Furoshiki::Shoes::Configuration.new options }
         | 
| 112 112 |  | 
| 113 | 
            -
                it {  | 
| 113 | 
            +
                it { is_expected.not_to be_valid }
         | 
| 114 114 | 
             
              end
         | 
| 115 115 |  | 
| 116 116 | 
             
              context "when osx icon is not specified" do
         | 
| @@ -120,11 +120,11 @@ describe Furoshiki::Shoes::Configuration do | |
| 120 120 | 
             
                subject { Furoshiki::Shoes::Configuration.new(options) }
         | 
| 121 121 |  | 
| 122 122 | 
             
                it "sets osx icon path to nil" do
         | 
| 123 | 
            -
                  subject.icons[:osx]. | 
| 123 | 
            +
                  expect(subject.icons[:osx]).to be_nil
         | 
| 124 124 | 
             
                end
         | 
| 125 125 |  | 
| 126 126 | 
             
                it "is valid" do
         | 
| 127 | 
            -
                  subject. | 
| 127 | 
            +
                  expect(subject).to be_valid
         | 
| 128 128 | 
             
                end
         | 
| 129 129 | 
             
              end
         | 
| 130 130 |  | 
| @@ -133,10 +133,10 @@ describe Furoshiki::Shoes::Configuration do | |
| 133 133 | 
             
                subject { Furoshiki::Shoes::Configuration.new options }
         | 
| 134 134 |  | 
| 135 135 | 
             
                it "sets osx icon path" do
         | 
| 136 | 
            -
                  subject.icons[:osx]. | 
| 136 | 
            +
                  expect(subject.icons[:osx]).to eq("path/to/non-existent/file")
         | 
| 137 137 | 
             
                end
         | 
| 138 138 |  | 
| 139 | 
            -
                it {  | 
| 139 | 
            +
                it { is_expected.not_to be_valid }
         | 
| 140 140 | 
             
              end
         | 
| 141 141 |  | 
| 142 142 | 
             
              context "auto-loading" do
         | 
| @@ -146,13 +146,13 @@ describe Furoshiki::Shoes::Configuration do | |
| 146 146 | 
             
                  it "looks for 'app.yaml' in current directory" do
         | 
| 147 147 | 
             
                    Dir.chdir @config_filename.parent do
         | 
| 148 148 | 
             
                      config = Furoshiki::Shoes::Configuration.load
         | 
| 149 | 
            -
                      config.shortname. | 
| 149 | 
            +
                      expect(config.shortname).to eq('sweet-nebulae')
         | 
| 150 150 | 
             
                    end
         | 
| 151 151 | 
             
                  end
         | 
| 152 152 |  | 
| 153 153 | 
             
                  it "blows up if it can't find the file" do
         | 
| 154 154 | 
             
                    Dir.chdir File.dirname(__FILE__) do
         | 
| 155 | 
            -
                       | 
| 155 | 
            +
                      expect { config = Furoshiki::Shoes::Configuration.load }.to raise_error
         | 
| 156 156 | 
             
                    end
         | 
| 157 157 | 
             
                  end
         | 
| 158 158 | 
             
                end
         | 
| @@ -161,7 +161,7 @@ describe Furoshiki::Shoes::Configuration do | |
| 161 161 | 
             
                  it "finds the config" do
         | 
| 162 162 | 
             
                    Dir.chdir File.dirname(__FILE__) do
         | 
| 163 163 | 
             
                      config = Furoshiki::Shoes::Configuration.load(path)
         | 
| 164 | 
            -
                      config.shortname. | 
| 164 | 
            +
                      expect(config.shortname).to eq('sweet-nebulae')
         | 
| 165 165 | 
             
                    end
         | 
| 166 166 | 
             
                  end
         | 
| 167 167 | 
             
                end
         | 
| @@ -191,7 +191,7 @@ describe Furoshiki::Shoes::Configuration do | |
| 191 191 |  | 
| 192 192 | 
             
                context "when the file doesn't exist" do
         | 
| 193 193 | 
             
                  it "blows up" do
         | 
| 194 | 
            -
                     | 
| 194 | 
            +
                    expect { Furoshiki::Shoes::Configuration.load('some/bogus/path') }.to raise_error
         | 
| 195 195 | 
             
                  end
         | 
| 196 196 | 
             
                end
         | 
| 197 197 | 
             
              end
         | 
    
        data/spec/shoes/spec_helper.rb
    CHANGED
    
    
    
        data/spec/shoes/swt_app_spec.rb
    CHANGED
    
    | @@ -38,7 +38,7 @@ describe Furoshiki::Shoes::SwtApp do | |
| 38 38 |  | 
| 39 39 | 
             
                it "sets package dir to {pwd}/pkg" do
         | 
| 40 40 | 
             
                  Dir.chdir @app_dir do
         | 
| 41 | 
            -
                    subject.default_package_dir. | 
| 41 | 
            +
                    expect(subject.default_package_dir).to eq(@app_dir.join 'pkg')
         | 
| 42 42 | 
             
                  end
         | 
| 43 43 | 
             
                end
         | 
| 44 44 |  | 
| @@ -63,35 +63,35 @@ describe Furoshiki::Shoes::SwtApp do | |
| 63 63 | 
             
                its(:template_path) { should exist }
         | 
| 64 64 |  | 
| 65 65 | 
             
                it "creates a .app" do
         | 
| 66 | 
            -
                  @output_file. | 
| 66 | 
            +
                  expect(@output_file).to exist
         | 
| 67 67 | 
             
                end
         | 
| 68 68 |  | 
| 69 69 | 
             
                it "includes launcher" do
         | 
| 70 | 
            -
                  launcher. | 
| 70 | 
            +
                  expect(launcher).to exist
         | 
| 71 71 | 
             
                end
         | 
| 72 72 |  | 
| 73 73 | 
             
                # Windows can't test this
         | 
| 74 74 | 
             
                platform_is_not :windows do
         | 
| 75 75 | 
             
                  it "makes launcher executable" do
         | 
| 76 | 
            -
                    launcher. | 
| 76 | 
            +
                    expect(launcher).to be_executable
         | 
| 77 77 | 
             
                  end
         | 
| 78 78 | 
             
                end
         | 
| 79 79 |  | 
| 80 80 | 
             
                it "deletes generic icon" do
         | 
| 81 | 
            -
                  icon.parent.join('GenericApp.icns'). | 
| 81 | 
            +
                  expect(icon.parent.join('GenericApp.icns')).not_to exist
         | 
| 82 82 | 
             
                end
         | 
| 83 83 |  | 
| 84 84 | 
             
                it "injects icon" do
         | 
| 85 | 
            -
                  icon. | 
| 85 | 
            +
                  expect(icon).to exist
         | 
| 86 86 | 
             
                end
         | 
| 87 87 |  | 
| 88 88 | 
             
                it "injects jar" do
         | 
| 89 | 
            -
                  jar. | 
| 89 | 
            +
                  expect(jar).to exist
         | 
| 90 90 | 
             
                end
         | 
| 91 91 |  | 
| 92 92 | 
             
                it "removes any extraneous jars" do
         | 
| 93 93 | 
             
                  jar_dir_contents = @output_file.join("Contents/Java").children
         | 
| 94 | 
            -
                  jar_dir_contents.reject {|f| f == jar }. | 
| 94 | 
            +
                  expect(jar_dir_contents.reject {|f| f == jar }).to be_empty
         | 
| 95 95 | 
             
                end
         | 
| 96 96 |  | 
| 97 97 | 
             
                describe "Info.plist" do
         | 
| @@ -101,23 +101,23 @@ describe Furoshiki::Shoes::SwtApp do | |
| 101 101 | 
             
                  end
         | 
| 102 102 |  | 
| 103 103 | 
             
                  it "sets identifier" do
         | 
| 104 | 
            -
                    @plist['CFBundleIdentifier']. | 
| 104 | 
            +
                    expect(@plist['CFBundleIdentifier']).to eq('com.hackety.shoes.sweet-nebulae')
         | 
| 105 105 | 
             
                  end
         | 
| 106 106 |  | 
| 107 107 | 
             
                  it "sets display name" do
         | 
| 108 | 
            -
                    @plist['CFBundleDisplayName']. | 
| 108 | 
            +
                    expect(@plist['CFBundleDisplayName']).to eq('Sugar Clouds')
         | 
| 109 109 | 
             
                  end
         | 
| 110 110 |  | 
| 111 111 | 
             
                  it "sets bundle name" do
         | 
| 112 | 
            -
                    @plist['CFBundleName']. | 
| 112 | 
            +
                    expect(@plist['CFBundleName']).to eq('Sugar Clouds')
         | 
| 113 113 | 
             
                  end
         | 
| 114 114 |  | 
| 115 115 | 
             
                  it "sets icon" do
         | 
| 116 | 
            -
                    @plist['CFBundleIconFile']. | 
| 116 | 
            +
                    expect(@plist['CFBundleIconFile']).to eq('boots.icns')
         | 
| 117 117 | 
             
                  end
         | 
| 118 118 |  | 
| 119 119 | 
             
                  it "sets version" do
         | 
| 120 | 
            -
                    @plist['CFBundleVersion']. | 
| 120 | 
            +
                    expect(@plist['CFBundleVersion']).to eq('0.0.1')
         | 
| 121 121 | 
             
                  end
         | 
| 122 122 | 
             
                end
         | 
| 123 123 | 
             
              end
         | 
| @@ -127,7 +127,7 @@ describe Furoshiki::Shoes::SwtApp do | |
| 127 127 | 
             
                subject { Furoshiki::Shoes::SwtApp.new config }
         | 
| 128 128 |  | 
| 129 129 | 
             
                it "fails to initialize" do
         | 
| 130 | 
            -
                   | 
| 130 | 
            +
                  expect { subject }.to raise_error(Furoshiki::ConfigurationError)
         | 
| 131 131 | 
             
                end
         | 
| 132 132 | 
             
              end
         | 
| 133 133 | 
             
            end
         | 
    
        data/spec/shoes/swt_jar_spec.rb
    CHANGED
    
    | @@ -25,20 +25,20 @@ describe Furoshiki::Shoes::SwtJar do | |
| 25 25 | 
             
                subject { @subject }
         | 
| 26 26 |  | 
| 27 27 | 
             
                it "creates a .jar" do
         | 
| 28 | 
            -
                  output_file. | 
| 28 | 
            +
                  expect(output_file).to exist
         | 
| 29 29 | 
             
                end
         | 
| 30 30 |  | 
| 31 31 | 
             
                it "returns path to .jar" do
         | 
| 32 | 
            -
                  @jar_path. | 
| 32 | 
            +
                  expect(@jar_path).to eq(output_file.to_s)
         | 
| 33 33 | 
             
                end
         | 
| 34 34 |  | 
| 35 35 | 
             
                it "creates .jar smaller than 50MB" do
         | 
| 36 | 
            -
                  File.size(output_file). | 
| 36 | 
            +
                  expect(File.size(output_file)).to be < 50 * 1024 * 1024
         | 
| 37 37 | 
             
                end
         | 
| 38 38 |  | 
| 39 39 | 
             
                it "excludes directories recursively" do
         | 
| 40 | 
            -
                  jar = Zip:: | 
| 41 | 
            -
                  jar.entries. | 
| 40 | 
            +
                  jar = Zip::File.new(output_file)
         | 
| 41 | 
            +
                  expect(jar.entries).not_to include("dir_to_ignore/file_to_ignore")
         | 
| 42 42 | 
             
                end
         | 
| 43 43 |  | 
| 44 44 | 
             
                its(:default_dir) { should eq(@output_dir) }
         | 
| @@ -50,7 +50,7 @@ describe Furoshiki::Shoes::SwtJar do | |
| 50 50 | 
             
                subject { Furoshiki::Shoes::SwtJar.new(config) }
         | 
| 51 51 |  | 
| 52 52 | 
             
                it "fails to initialize" do
         | 
| 53 | 
            -
                   | 
| 53 | 
            +
                  expect { subject }.to raise_error(Furoshiki::ConfigurationError)
         | 
| 54 54 | 
             
                end
         | 
| 55 55 | 
             
              end
         | 
| 56 56 | 
             
            end
         | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    
    
        data/spec/support/shared_zip.rb
    CHANGED
    
    | @@ -10,7 +10,7 @@ end | |
| 10 10 | 
             
            shared_context 'zip' do
         | 
| 11 11 | 
             
              include_context 'package'
         | 
| 12 12 | 
             
              let(:output_file) { @output_dir.join 'zip_directory_spec.zip' }
         | 
| 13 | 
            -
              let(:zip) { Zip:: | 
| 13 | 
            +
              let(:zip) { Zip::File.open output_file }
         | 
| 14 14 |  | 
| 15 15 | 
             
              before :all do
         | 
| 16 16 | 
             
                @output_dir.mkpath
         | 
| @@ -10,20 +10,20 @@ describe Furoshiki::Zip::DirectoryContents do | |
| 10 10 | 
             
                before :all do
         | 
| 11 11 | 
             
                  zip_directory_contents = Furoshiki::Zip::DirectoryContents.new input_dir, @output_file
         | 
| 12 12 | 
             
                  zip_directory_contents.write
         | 
| 13 | 
            -
                  @zip = Zip:: | 
| 13 | 
            +
                  @zip = Zip::File.open @output_file
         | 
| 14 14 | 
             
                end
         | 
| 15 15 |  | 
| 16 16 | 
             
                it "exists" do
         | 
| 17 | 
            -
                  @output_file. | 
| 17 | 
            +
                  expect(@output_file).to exist
         | 
| 18 18 | 
             
                end
         | 
| 19 19 |  | 
| 20 20 | 
             
                it "does not include input directory without parents" do
         | 
| 21 | 
            -
                  @zip.entries.map(&:name). | 
| 21 | 
            +
                  expect(@zip.entries.map(&:name)).not_to include(add_trailing_slash input_dir.basename)
         | 
| 22 22 | 
             
                end
         | 
| 23 23 |  | 
| 24 24 | 
             
                relative_input_paths(input_dir).each do |path|
         | 
| 25 25 | 
             
                  it "includes all children of input directory" do
         | 
| 26 | 
            -
                    @zip.entries.map(&:name). | 
| 26 | 
            +
                    expect(@zip.entries.map(&:name)).to include(path)
         | 
| 27 27 | 
             
                  end
         | 
| 28 28 | 
             
                end
         | 
| 29 29 | 
             
              end
         | 
    
        data/spec/zip/directory_spec.rb
    CHANGED
    
    | @@ -11,26 +11,26 @@ describe Furoshiki::Zip::Directory do | |
| 11 11 | 
             
                before :all do
         | 
| 12 12 | 
             
                  zip_directory = Furoshiki::Zip::Directory.new input_dir, @output_file
         | 
| 13 13 | 
             
                  zip_directory.write
         | 
| 14 | 
            -
                  @zip = Zip:: | 
| 14 | 
            +
                  @zip = ::Zip::File.open @output_file
         | 
| 15 15 | 
             
                end
         | 
| 16 16 |  | 
| 17 17 | 
             
                it "exists" do
         | 
| 18 | 
            -
                  @output_file. | 
| 18 | 
            +
                  expect(@output_file).to exist
         | 
| 19 19 | 
             
                end
         | 
| 20 20 |  | 
| 21 21 | 
             
                it "includes input directory without parents" do
         | 
| 22 | 
            -
                  @zip.entries.map(&:name). | 
| 22 | 
            +
                  expect(@zip.entries.map(&:name)).to include(add_trailing_slash input_dir.basename)
         | 
| 23 23 | 
             
                end
         | 
| 24 24 |  | 
| 25 25 | 
             
                relative_input_paths(input_dir.parent).each do |path|
         | 
| 26 26 | 
             
                  it "includes all children of input directory" do
         | 
| 27 | 
            -
                    @zip.entries.map(&:name). | 
| 27 | 
            +
                    expect(@zip.entries.map(&:name)).to include(path)
         | 
| 28 28 | 
             
                  end
         | 
| 29 29 | 
             
                end
         | 
| 30 30 |  | 
| 31 31 | 
             
                it "doesn't include extra files" do
         | 
| 32 32 | 
             
                  number_of_files = Dir.glob("#{input_dir}/**/*").push(input_dir).length
         | 
| 33 | 
            -
                  @zip.entries.length. | 
| 33 | 
            +
                  expect(@zip.entries.length).to eq(number_of_files)
         | 
| 34 34 | 
             
                end
         | 
| 35 35 | 
             
              end
         | 
| 36 36 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,30 +1,27 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: furoshiki
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
               | 
| 5 | 
            -
              version: 0.1.2
         | 
| 4 | 
            +
              version: 0.2.0
         | 
| 6 5 | 
             
            platform: ruby
         | 
| 7 6 | 
             
            authors:
         | 
| 8 7 | 
             
            - Steve Klabnik
         | 
| 9 8 | 
             
            autorequire:
         | 
| 10 9 | 
             
            bindir: bin
         | 
| 11 10 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date:  | 
| 11 | 
            +
            date: 2014-09-28 00:00:00.000000000 Z
         | 
| 13 12 | 
             
            dependencies:
         | 
| 14 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 14 | 
             
              name: warbler
         | 
| 16 15 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 17 16 | 
             
                requirements:
         | 
| 18 | 
            -
                - -  | 
| 17 | 
            +
                - - ~>
         | 
| 19 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 20 | 
            -
                    version:  | 
| 21 | 
            -
                none: false
         | 
| 19 | 
            +
                    version: 1.4.4
         | 
| 22 20 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 23 21 | 
             
                requirements:
         | 
| 24 | 
            -
                - -  | 
| 22 | 
            +
                - - ~>
         | 
| 25 23 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            -
                    version:  | 
| 27 | 
            -
                none: false
         | 
| 24 | 
            +
                    version: 1.4.4
         | 
| 28 25 | 
             
              prerelease: false
         | 
| 29 26 | 
             
              type: :runtime
         | 
| 30 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| @@ -34,29 +31,25 @@ dependencies: | |
| 34 31 | 
             
                - - '>='
         | 
| 35 32 | 
             
                  - !ruby/object:Gem::Version
         | 
| 36 33 | 
             
                    version: '0'
         | 
| 37 | 
            -
                none: false
         | 
| 38 34 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 39 35 | 
             
                requirements:
         | 
| 40 36 | 
             
                - - '>='
         | 
| 41 37 | 
             
                  - !ruby/object:Gem::Version
         | 
| 42 38 | 
             
                    version: '0'
         | 
| 43 | 
            -
                none: false
         | 
| 44 39 | 
             
              prerelease: false
         | 
| 45 40 | 
             
              type: :runtime
         | 
| 46 41 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 47 42 | 
             
              name: rubyzip
         | 
| 48 43 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 49 44 | 
             
                requirements:
         | 
| 50 | 
            -
                - -  | 
| 45 | 
            +
                - - '>='
         | 
| 51 46 | 
             
                  - !ruby/object:Gem::Version
         | 
| 52 47 | 
             
                    version: 1.0.0
         | 
| 53 | 
            -
                none: false
         | 
| 54 48 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 55 49 | 
             
                requirements:
         | 
| 56 | 
            -
                - -  | 
| 50 | 
            +
                - - '>='
         | 
| 57 51 | 
             
                  - !ruby/object:Gem::Version
         | 
| 58 52 | 
             
                    version: 1.0.0
         | 
| 59 | 
            -
                none: false
         | 
| 60 53 | 
             
              prerelease: false
         | 
| 61 54 | 
             
              type: :runtime
         | 
| 62 55 | 
             
            - !ruby/object:Gem::Dependency
         | 
| @@ -66,13 +59,11 @@ dependencies: | |
| 66 59 | 
             
                - - '>='
         | 
| 67 60 | 
             
                  - !ruby/object:Gem::Version
         | 
| 68 61 | 
             
                    version: '0'
         | 
| 69 | 
            -
                none: false
         | 
| 70 62 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 71 63 | 
             
                requirements:
         | 
| 72 64 | 
             
                - - '>='
         | 
| 73 65 | 
             
                  - !ruby/object:Gem::Version
         | 
| 74 66 | 
             
                    version: '0'
         | 
| 75 | 
            -
                none: false
         | 
| 76 67 | 
             
              prerelease: false
         | 
| 77 68 | 
             
              type: :development
         | 
| 78 69 | 
             
            - !ruby/object:Gem::Dependency
         | 
| @@ -82,13 +73,39 @@ dependencies: | |
| 82 73 | 
             
                - - '>='
         | 
| 83 74 | 
             
                  - !ruby/object:Gem::Version
         | 
| 84 75 | 
             
                    version: '0'
         | 
| 85 | 
            -
                none: false
         | 
| 86 76 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 87 77 | 
             
                requirements:
         | 
| 88 78 | 
             
                - - '>='
         | 
| 89 79 | 
             
                  - !ruby/object:Gem::Version
         | 
| 90 80 | 
             
                    version: '0'
         | 
| 91 | 
            -
             | 
| 81 | 
            +
              prerelease: false
         | 
| 82 | 
            +
              type: :development
         | 
| 83 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 84 | 
            +
              name: rspec-its
         | 
| 85 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 86 | 
            +
                requirements:
         | 
| 87 | 
            +
                - - '>='
         | 
| 88 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 89 | 
            +
                    version: '0'
         | 
| 90 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 91 | 
            +
                requirements:
         | 
| 92 | 
            +
                - - '>='
         | 
| 93 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 94 | 
            +
                    version: '0'
         | 
| 95 | 
            +
              prerelease: false
         | 
| 96 | 
            +
              type: :development
         | 
| 97 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 98 | 
            +
              name: pry
         | 
| 99 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 100 | 
            +
                requirements:
         | 
| 101 | 
            +
                - - '>='
         | 
| 102 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 103 | 
            +
                    version: '0'
         | 
| 104 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 105 | 
            +
                requirements:
         | 
| 106 | 
            +
                - - '>='
         | 
| 107 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 108 | 
            +
                    version: '0'
         | 
| 92 109 | 
             
              prerelease: false
         | 
| 93 110 | 
             
              type: :development
         | 
| 94 111 | 
             
            description: Create .app, .exe, and $LINUX_PACKAGE versions of your application, with its own embedded Ruby.
         | 
| @@ -142,6 +159,7 @@ files: | |
| 142 159 | 
             
            - vendor/appbundler-1.0.jar
         | 
| 143 160 | 
             
            homepage: http://github.com/steveklabnik/furoshiki
         | 
| 144 161 | 
             
            licenses: []
         | 
| 162 | 
            +
            metadata: {}
         | 
| 145 163 | 
             
            post_install_message:
         | 
| 146 164 | 
             
            rdoc_options: []
         | 
| 147 165 | 
             
            require_paths:
         | 
| @@ -151,23 +169,15 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 151 169 | 
             
              - - '>='
         | 
| 152 170 | 
             
                - !ruby/object:Gem::Version
         | 
| 153 171 | 
             
                  version: '0'
         | 
| 154 | 
            -
                  segments:
         | 
| 155 | 
            -
                  - 0
         | 
| 156 | 
            -
                  hash: 2
         | 
| 157 | 
            -
              none: false
         | 
| 158 172 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 159 173 | 
             
              requirements:
         | 
| 160 174 | 
             
              - - '>='
         | 
| 161 175 | 
             
                - !ruby/object:Gem::Version
         | 
| 162 176 | 
             
                  version: '0'
         | 
| 163 | 
            -
                  segments:
         | 
| 164 | 
            -
                  - 0
         | 
| 165 | 
            -
                  hash: 2
         | 
| 166 | 
            -
              none: false
         | 
| 167 177 | 
             
            requirements: []
         | 
| 168 178 | 
             
            rubyforge_project:
         | 
| 169 | 
            -
            rubygems_version: 1. | 
| 179 | 
            +
            rubygems_version: 2.1.9
         | 
| 170 180 | 
             
            signing_key:
         | 
| 171 | 
            -
            specification_version:  | 
| 181 | 
            +
            specification_version: 4
         | 
| 172 182 | 
             
            summary: Package and distribute applications with Ruby.
         | 
| 173 183 | 
             
            test_files: []
         |