roopap 0.0.6 → 0.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f500a3565a08cf7ab821172f49331c39b4f7b5ee
4
- data.tar.gz: bdd59573c7f1153bfc0482ae14fa9684dc636db3
3
+ metadata.gz: 672810c254095d24c4d5ec678c51cde3ec312ec9
4
+ data.tar.gz: aeea51b45ac67ba901c75a20785bb2d2027c4068
5
5
  SHA512:
6
- metadata.gz: 4701be3a6cc3cc581c582c79c41cf11b7c14f7a0966ab07a6b61ca862bf81884a491fcf81dc6256615e082ddfb93dcf006ef25bd2322692a9d524e7f1131231a
7
- data.tar.gz: 2f9ab9bd7b3c6078ee1e944ed66689073226c6efa52b9147a25e3aec8a9cacfc2b3f3b5f04a524930f98b0de0251524a25944d9ee0b3705d808c4dbc8eb9b23a
6
+ metadata.gz: df33c2f0c896120746e51db2d8229060ba1925a8f3ec1356c6a170ee16156d636e1730b5bae19c2a12187068cf0072e0ac38b4df30ff78f0452b207d75736691
7
+ data.tar.gz: 5719c2eaa6549d9a4caa0de5bb5d8c438bf5938a39dad4fc72bdea8fcb03b8c0a656a7a13b40b8a42a66127ff20b6ede49a113c20cebd41c8b30c928d6632737
@@ -39,7 +39,7 @@ module Roopap
39
39
  dir_name = time.utc.strftime('%Y-%m')
40
40
  dir_path = File.join(root, dir_name)
41
41
  prepare_dir(dir_path)
42
- filename = gen_filename(time, filepath)
42
+ filename = gen_filename(filepath)
43
43
  File.join(dir_path, filename)
44
44
  end
45
45
 
@@ -50,8 +50,8 @@ module Roopap
50
50
  time
51
51
  end
52
52
 
53
- def gen_filename(time, filepath)
54
- "#{time.to_i}-#{Digest::MD5.hexdigest(File.read(filepath))[0..9]}.jpg"
53
+ def gen_filename(filepath)
54
+ "#{Digest::MD5.hexdigest(File.read(filepath))[0..9]}.jpg"
55
55
  end
56
56
 
57
57
  def prepare_dir(path)
@@ -1,3 +1,3 @@
1
1
  module Roopap
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -19,8 +19,8 @@ describe "Calling Roopap via shell command" do
19
19
 
20
20
  `bin/roopap #{from} #{target}`
21
21
 
22
- assert FileTest.exists?("#{target}/2006-01/1137496843-e489272393.jpg"), "No file in the target directory"
23
- assert FileTest.exists?("#{target}/2011-04/1301726919-bb455c47e4.jpg"), "No file in the target directory"
22
+ assert FileTest.exists?("#{target}/2006-01/e489272393.jpg"), "No file in the target directory"
23
+ assert FileTest.exists?("#{target}/2011-04/bb455c47e4.jpg"), "No file in the target directory"
24
24
  end
25
25
 
26
26
  it "displays number of copied files" do
@@ -22,8 +22,8 @@ module Roopap
22
22
 
23
23
  Organizer.new.perform(source, target)
24
24
 
25
- assert FileTest.exists?("#{target}/2006-01/1137496843-e489272393.jpg"), "No file in the target directory"
26
- assert FileTest.exists?("#{target}/2011-04/1301726919-bb455c47e4.jpg"), "No file in the target directory"
25
+ assert FileTest.exists?("#{target}/2006-01/e489272393.jpg"), "No file in the target directory"
26
+ assert FileTest.exists?("#{target}/2011-04/bb455c47e4.jpg"), "No file in the target directory"
27
27
  end
28
28
 
29
29
  it "ignores non jpg file" do
@@ -32,7 +32,7 @@ module Roopap
32
32
 
33
33
  Organizer.new.perform(source, target)
34
34
 
35
- assert FileTest.exists?("#{target}/2006-01/1137496843-e489272393.jpg"), "No file in the target directory"
35
+ assert FileTest.exists?("#{target}/2006-01/e489272393.jpg"), "No file in the target directory"
36
36
  end
37
37
 
38
38
  it "returns number of organized files" do
@@ -55,7 +55,7 @@ module Roopap
55
55
  o.perform(source, target)
56
56
  end
57
57
 
58
- assert FileTest.exists?("#{target}/2011-02/1297863330-e489272393.jpg"), "No file in the target directory"
58
+ assert FileTest.exists?("#{target}/2011-02/e489272393.jpg"), "No file in the target directory"
59
59
  end
60
60
  end
61
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roopap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nuttanart Pornprasitsakul
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-30 00:00:00.000000000 Z
11
+ date: 2013-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler