fontdock 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b6f62319d0ba956deef7b4c67790995af5335ff
4
- data.tar.gz: 4659e3624a1775b9b96231ceb58b8d31ba356bea
3
+ metadata.gz: b0d8b6415e1e9ac396c9fb81b07a86c8e7fed25a
4
+ data.tar.gz: b1ac8c6bb4ca1375fa5d31da546f37e7638949ec
5
5
  SHA512:
6
- metadata.gz: a25eaa9a90f54232c0494531635357aa8780fee4b736becaedeee2d8da7e8fb8092efc60a8271d5f4c25315e1fa2fead478a1d11088df6f585b4567a3d79caa1
7
- data.tar.gz: 49398d9219baabc0bd26e794aa038d06e74f29fe6305f2aaf08418c2dac8aada3ab9bf2241bea2c16fc9ca03bfc5269aff8f8a329ce1c07d0799813ea0c5bd24
6
+ metadata.gz: 5e31796892153c2dd2c0ab5aab52feb6abaee801af89ae31e448272ade6d919b8cebb96920ed474cc7639e5857627f6d09253ee9173a9052726cb0b0f5096ba2
7
+ data.tar.gz: 5125b75c6336ade3a2ad5f59ac7f447fd02b39b005eb00ef54d7e57d24fccc617bff3fd96e2d9323dbce7b94778603eff92d66a10e9dc5016b0f171fd90f98ed
data/NEWS.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # NEWS
2
2
 
3
+ ## 0.0.2: 2014-01-05
4
+
5
+ ### Improvement
6
+
7
+ * Added version command.
8
+ * Added Local.find method.
9
+
3
10
  ## 0.0.1: 2013-12-19
4
11
 
5
12
  Initial release!
data/README.md CHANGED
@@ -25,13 +25,13 @@ Or install it yourself as:
25
25
 
26
26
  ### Command Line
27
27
 
28
- #### List abailable fonts
28
+ #### List available fonts
29
29
 
30
30
  $ fontdock ls
31
31
 
32
32
  ### Library
33
33
 
34
- #### Get abailable font names
34
+ #### Get available font names
35
35
 
36
36
  ```ruby
37
37
  require "fontdock"
@@ -4,6 +4,11 @@ require "fontdock"
4
4
 
5
5
  module Fontdock
6
6
  class Command < Thor
7
+ desc "version", "Show version number"
8
+ def version
9
+ puts VERSION
10
+ end
11
+
7
12
  desc "ls", "List available font families"
8
13
  def ls
9
14
  Fontdock::Local.names.sort.uniq.each {|name| puts name }
@@ -14,6 +14,22 @@ module Fontdock
14
14
  def names
15
15
  families.collect {|family| family.name }
16
16
  end
17
+
18
+ def find(part_of_name)
19
+ find_from_pattern(/\A#{part_of_name}\z/) ||
20
+ find_from_pattern(/\A#{part_of_name}\z/i) ||
21
+ find_from_pattern(/\A#{part_of_name}/) ||
22
+ find_from_pattern(/\A#{part_of_name}/i) ||
23
+ find_from_pattern(/#{part_of_name}/) ||
24
+ find_from_pattern(/#{part_of_name}/i)
25
+ end
26
+
27
+ private
28
+ def find_from_pattern(pattern)
29
+ names.find do |name|
30
+ pattern =~ name
31
+ end
32
+ end
17
33
  end
18
34
  end
19
35
  end
@@ -1,3 +1,3 @@
1
1
  module Fontdock
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -0,0 +1,13 @@
1
+ require "fontdock/local"
2
+
3
+ class LocalTest < Test::Unit::TestCase
4
+ class FindTest < self
5
+ def test_found
6
+ assert_not_nil(Fontdock::Local.find("M"))
7
+ end
8
+
9
+ def test_not_found
10
+ assert_nil(Fontdock::Local.find("ABCDE12345"))
11
+ end
12
+ end
13
+ end
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fontdock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masafumi Yokoyama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-19 00:00:00.000000000 Z
11
+ date: 2014-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pango
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: thor
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: test-unit
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: test-unit-notify
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: test-unit-rr
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: '1.3'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.3'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  description: A toolbox for managing font families.
@@ -116,8 +116,8 @@ executables:
116
116
  extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
- - .gitignore
120
- - .travis.yml
119
+ - ".gitignore"
120
+ - ".travis.yml"
121
121
  - Gemfile
122
122
  - LICENSE.txt
123
123
  - NEWS.md
@@ -131,6 +131,7 @@ files:
131
131
  - lib/fontdock/version.rb
132
132
  - test/run-test.rb
133
133
  - test/test-command.rb
134
+ - test/test-local.rb
134
135
  homepage: https://github.com/myokoym/fontdock
135
136
  licenses:
136
137
  - MIT
@@ -141,21 +142,21 @@ require_paths:
141
142
  - lib
142
143
  required_ruby_version: !ruby/object:Gem::Requirement
143
144
  requirements:
144
- - - '>='
145
+ - - ">="
145
146
  - !ruby/object:Gem::Version
146
147
  version: '0'
147
148
  required_rubygems_version: !ruby/object:Gem::Requirement
148
149
  requirements:
149
- - - '>='
150
+ - - ">="
150
151
  - !ruby/object:Gem::Version
151
152
  version: '0'
152
153
  requirements: []
153
154
  rubyforge_project:
154
- rubygems_version: 2.0.14
155
+ rubygems_version: 2.2.0
155
156
  signing_key:
156
157
  specification_version: 4
157
158
  summary: Fonts Toolbox
158
159
  test_files:
159
160
  - test/run-test.rb
160
161
  - test/test-command.rb
161
- has_rdoc:
162
+ - test/test-local.rb