s3itch_client 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,8 @@
1
+ ## Contributing
2
+
3
+ 1. Fork it
4
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
5
+ 3. Check that the test suite passes and add new specs if necessary
6
+ 4. Commit your changes (`git commit -am 'Add some feature'`)
7
+ 5. Push to the branch (`git push origin my-new-feature`)
8
+ 6. Create new Pull Request
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- s3itch_client (1.0.0)
4
+ s3itch_client (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -4,7 +4,7 @@ Upload files to your [s3itch][s3itch] instance directly from the command line.
4
4
 
5
5
  Each file is given a unique, unguessable filename based on the original filename. e.g. `kitten.jpeg` will be turned into something like:
6
6
 
7
- `kitten_def46901-9dfc-47ad-86b5-c6831d65d9ed.jpeg`.
7
+ kitten_def46901-9dfc-47ad-86b5-c6831d65d9ed.jpeg
8
8
 
9
9
  ## Installation & Configuration
10
10
 
@@ -36,12 +36,19 @@ If you've configured you `~/.s3itch.yml` correctly, uploading an image is as sim
36
36
 
37
37
  s3itch kittens.jpeg
38
38
 
39
+ ## Tests [![Build Status](https://secure.travis-ci.org/k33l0r/s3itch_client.png)](http://travis-ci.org/k33l0r/s3itch_client)
40
+
41
+ S3itch Client is tested with RSpec:
42
+
43
+ bundle exec rake spec
44
+
39
45
  ## Contributing
40
46
 
41
47
  1. Fork it
42
48
  2. Create your feature branch (`git checkout -b my-new-feature`)
43
- 3. Commit your changes (`git commit -am 'Add some feature'`)
44
- 4. Push to the branch (`git push origin my-new-feature`)
45
- 5. Create new Pull Request
49
+ 3. Check that the test suite passes and add new specs if necessary
50
+ 4. Commit your changes (`git commit -am 'Add some feature'`)
51
+ 5. Push to the branch (`git push origin my-new-feature`)
52
+ 6. Create new Pull Request
46
53
 
47
54
  [s3itch]: https://github.com/roidrage/s3itch
data/lib/s3itch_client.rb CHANGED
@@ -51,7 +51,7 @@ module S3itchClient
51
51
  # Ruby 1.8.7 compatibility
52
52
  uuid = SecureRandom.respond_to?(:uuid) ? SecureRandom.uuid : SecureRandom.hex
53
53
 
54
- "#{basename}_#{uuid}#{extname}"
54
+ URI.encode("#{basename}_#{uuid}#{extname}")
55
55
  end
56
56
 
57
57
  def self.indifferent_hash(hash)
@@ -1,3 +1,3 @@
1
1
  module S3itchClient
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -31,6 +31,11 @@ describe S3itchClient do
31
31
  name = S3itchClient.build_unique_name(kitten_path)
32
32
  name.should match(/\Akitten_[\da-z-]{32,36}\.jpeg\z/)
33
33
  end
34
+
35
+ it "URI encodes the file name" do
36
+ name = S3itchClient.build_unique_name("/tmp/cute kitten.jpeg")
37
+ name.should match(/\Acute%20kitten_[\da-z-]{32,36}\.jpeg\z/)
38
+ end
34
39
  end
35
40
 
36
41
  describe ".upload" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3itch_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-29 00:00:00.000000000 Z
12
+ date: 2012-09-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -102,6 +102,7 @@ files:
102
102
  - .gitignore
103
103
  - .rspec
104
104
  - .travis.yml
105
+ - CONTRIBUTING.md
105
106
  - Gemfile
106
107
  - Gemfile.lock
107
108
  - LICENSE.txt
@@ -129,7 +130,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
130
  version: '0'
130
131
  segments:
131
132
  - 0
132
- hash: 566530295880295081
133
+ hash: -3642218463313132411
133
134
  required_rubygems_version: !ruby/object:Gem::Requirement
134
135
  none: false
135
136
  requirements:
@@ -138,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
139
  version: '0'
139
140
  segments:
140
141
  - 0
141
- hash: 566530295880295081
142
+ hash: -3642218463313132411
142
143
  requirements: []
143
144
  rubyforge_project:
144
145
  rubygems_version: 1.8.24