touchy 0.0.7 → 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 689042d13ea63dd0b0be7643934530a93937513d
4
+ data.tar.gz: ff5e3c5c76119d55a04b237fbc03426dd41c8aed
5
+ SHA512:
6
+ metadata.gz: 7bcd706a7f93728ab898abc82c9dcb37133e38857feebabe6458deb21de770170bdd572fd29d35e2e5bdaca43c21e2d2c3759762654b3767eac40d3b035f209f
7
+ data.tar.gz: 5d2dfe577a88d43e651653456256b890950d2ab54fa94290603318bd9c2d0812e1eb52a44173a3448e5140f04b21f929b1c1f2cc0fcb2412f10ebab8edbedff0
data/README.md CHANGED
@@ -21,12 +21,20 @@ $ gem install touchy
21
21
  $ touchy odd ./hoge/*.png
22
22
  ```
23
23
 
24
+ or you can use [Ruby glob](http://docs.ruby-lang.org/ja/1.9.3/method/Dir/s/glob.html) path option.
25
+
26
+ ```bash
27
+ $ touchy odd --path='./hoge/**/*.png'
28
+ ```
29
+
24
30
  ### Find the odd size images and extend this size to even one, and fill the space with transparent pixel.
25
31
 
26
32
  ```bash
27
- $ touchy odd ./hoge/*.png
33
+ $ touchy fix ./hoge/*.png
28
34
  ```
29
35
 
36
+ The arguments are same as odd method.
37
+
30
38
  ## Contributing
31
39
 
32
40
  1. Fork it ( http://github.com/<my-github-username>/touchy/fork )
data/README_JP.md CHANGED
@@ -4,8 +4,8 @@
4
4
 
5
5
  ## インストール
6
6
 
7
- 1. Ruby 1.8.7以上をインストールして下さい。
8
- 2. コンソールで以下のコマンドを実行して下さい。
7
+ 1. Ruby 1.8.7以上をインストールする
8
+ 2. コンソールで以下のコマンドを実行する
9
9
 
10
10
  ```bash
11
11
  $ gem install touchy
@@ -16,19 +16,19 @@ $ gem install touchy
16
16
  ### 奇数サイズの画像を探し出す
17
17
 
18
18
  ```bash
19
- touchy odd 画像のパス
19
+ $ touchy odd ./hoge/*.png
20
20
  ```
21
21
 
22
- #### 例
23
-
24
- ./hogeディレクトリ直下のpngファイルの中から探す。
22
+ もしくは、[Rubyのglob](http://docs.ruby-lang.org/ja/1.9.3/method/Dir/s/glob.html)に基づいたパスを指定することもできます。
25
23
 
26
24
  ```bash
27
- touchy odd ./hoge/*.png
25
+ $ touchy odd --path='./hoge/**/*.png'
28
26
  ```
29
27
 
30
28
  ### 奇数サイズの画像を探し出し、偶数サイズに修正した上で、生じた隙間を透明なピクセルで埋める
31
29
 
32
30
  ```bash
33
- touchy fix 画像のパス
31
+ $ touchy fix ./hoge/*.png
34
32
  ```
33
+
34
+ 引数についてはoddメソッドと同じです。
data/bin/touchy CHANGED
@@ -7,7 +7,13 @@ require "touchy"
7
7
  module Touchy
8
8
  class Command < Thor
9
9
  desc "odd", "search odd size images"
10
- def odd(*path)
10
+ option :path, :type => :string
11
+ def odd(*_path)
12
+ if options[:path]
13
+ path = Dir.glob(options[:path])
14
+ else
15
+ path = _path
16
+ end
11
17
  found = Touchy.find_odd_size_images(path)
12
18
 
13
19
  found.each do |path|
@@ -17,7 +23,13 @@ module Touchy
17
23
  end
18
24
 
19
25
  desc "fix", "fix image's size to even"
20
- def fix(*path)
26
+ option :path, :type => :string
27
+ def fix(*_path)
28
+ if options[:path]
29
+ path = Dir.glob(options[:path])
30
+ else
31
+ path = _path
32
+ end
21
33
  found = Touchy.find_odd_size_images(path)
22
34
 
23
35
  found.each do |path|
@@ -1,3 +1,3 @@
1
1
  module Touchy
2
- VERSION = "0.0.7"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: touchy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
5
- prerelease:
4
+ version: 0.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Masami Yonehara
@@ -14,81 +13,71 @@ dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: thor
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0.19'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0.19'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: fastimage
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rmagick
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: bundler
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ~>
59
+ - - "~>"
68
60
  - !ruby/object:Gem::Version
69
61
  version: '1.5'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ~>
66
+ - - "~>"
76
67
  - !ruby/object:Gem::Version
77
68
  version: '1.5'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rake
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  description: the tool that find odd images
@@ -99,7 +88,7 @@ executables:
99
88
  extensions: []
100
89
  extra_rdoc_files: []
101
90
  files:
102
- - .gitignore
91
+ - ".gitignore"
103
92
  - Gemfile
104
93
  - LICENSE.txt
105
94
  - README.md
@@ -112,26 +101,25 @@ files:
112
101
  homepage: ''
113
102
  licenses:
114
103
  - MIT
104
+ metadata: {}
115
105
  post_install_message:
116
106
  rdoc_options: []
117
107
  require_paths:
118
108
  - lib
119
109
  required_ruby_version: !ruby/object:Gem::Requirement
120
- none: false
121
110
  requirements:
122
- - - ! '>='
111
+ - - ">="
123
112
  - !ruby/object:Gem::Version
124
113
  version: '0'
125
114
  required_rubygems_version: !ruby/object:Gem::Requirement
126
- none: false
127
115
  requirements:
128
- - - ! '>='
116
+ - - ">="
129
117
  - !ruby/object:Gem::Version
130
118
  version: '0'
131
119
  requirements: []
132
120
  rubyforge_project:
133
- rubygems_version: 1.8.23
121
+ rubygems_version: 2.2.2
134
122
  signing_key:
135
- specification_version: 3
123
+ specification_version: 4
136
124
  summary: the tool that find odd images
137
125
  test_files: []