codename 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,6 +8,7 @@ lib/codename.rb
8
8
  lib/codename/generator.rb
9
9
  lib/codename/lister.rb
10
10
  lib/codename/lister/factory.rb
11
+ lib/codename/lister/adjectives_lister.rb
11
12
  lib/codename/lister/base_lister.rb
12
13
  lib/codename/lister/colors_lister.rb
13
14
  lib/codename/lister/cyclones_lister.rb
data/README.txt CHANGED
@@ -4,9 +4,9 @@ home :: https://github.com/siuying/codename
4
4
 
5
5
  == DESCRIPTION:
6
6
 
7
- Codename gem randomly generate codename based on list of sources.
7
+ Codename gem randomly generate codename based on list of names.
8
8
 
9
- Supported sources:
9
+ Supported names:
10
10
 
11
11
  * stars - Western constellation names
12
12
  * elements - Elements names
@@ -18,7 +18,7 @@ Supported sources:
18
18
 
19
19
  You may generate names by "generate" command
20
20
 
21
- % codename generate source [more_source]...
21
+ % codename generate list_name [more_list_name_]...
22
22
 
23
23
  example:
24
24
 
@@ -40,10 +40,11 @@ Supported sources:
40
40
  Usage: codename generate list_name [more_list_name]...
41
41
  Usage: codename help
42
42
  list names:
43
+ adjs - Common adjectives
43
44
  stars - Western constellation names
44
45
  elements - Elements names
45
46
  colors - Colour names
46
- cyclones - Names of tropical cyclones
47
+ cyclones - Tropical cyclone names
47
48
  random - Random numbers (00000 - 99999)
48
49
 
49
50
  == REQUIREMENTS:
@@ -5,5 +5,5 @@ require 'codename/generator'
5
5
  require 'codename/lister'
6
6
 
7
7
  class Codename
8
- VERSION = '1.0.0'
8
+ VERSION = '1.1.0'
9
9
  end
@@ -3,6 +3,7 @@ $:.unshift(path) unless $:.include?(path)
3
3
 
4
4
  require 'lister/factory'
5
5
  require 'lister/base_lister'
6
+ require 'lister/adjectives_lister'
6
7
  require 'lister/stars_lister'
7
8
  require 'lister/elements_lister'
8
9
  require 'lister/colors_lister'
@@ -0,0 +1,24 @@
1
+ require 'rubygems'
2
+ require 'nokogiri'
3
+ require 'open-uri'
4
+
5
+ module Codename::Lister
6
+ class AdjectivesLister < BaseLister
7
+ URL = "http://www.esldesk.com/content/voc/adjectives.js"
8
+
9
+ def list
10
+ doc = open(URL).read
11
+ doc.split("\n").collect {|line| line.match(/\"(.+);\"/)[1] rescue nil }.compact
12
+ end
13
+
14
+ def name
15
+ "adjs"
16
+ end
17
+
18
+ def description
19
+ "Common adjectives"
20
+ end
21
+
22
+ Factory.instance.register(AdjectivesLister)
23
+ end
24
+ end
@@ -20,7 +20,7 @@ module Codename::Lister
20
20
  end
21
21
 
22
22
  def description
23
- "Names of tropical cyclones"
23
+ "Tropical cyclone names"
24
24
  end
25
25
 
26
26
  Factory.instance.register(CyclonesLister)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codename
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
+ - 1
8
9
  - 0
9
- - 0
10
- version: 1.0.0
10
+ version: 1.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Francis Chong
@@ -64,9 +64,9 @@ dependencies:
64
64
  type: :development
65
65
  version_requirements: *id003
66
66
  description: |-
67
- Codename gem randomly generate codename based on list of sources.
67
+ Codename gem randomly generate codename based on list of names.
68
68
 
69
- Supported sources:
69
+ Supported names:
70
70
 
71
71
  * stars - Western constellation names
72
72
  * elements - Elements names
@@ -94,6 +94,7 @@ files:
94
94
  - lib/codename/generator.rb
95
95
  - lib/codename/lister.rb
96
96
  - lib/codename/lister/factory.rb
97
+ - lib/codename/lister/adjectives_lister.rb
97
98
  - lib/codename/lister/base_lister.rb
98
99
  - lib/codename/lister/colors_lister.rb
99
100
  - lib/codename/lister/cyclones_lister.rb
@@ -134,6 +135,6 @@ rubyforge_project: codename
134
135
  rubygems_version: 1.8.10
135
136
  signing_key:
136
137
  specification_version: 3
137
- summary: Codename gem randomly generate codename based on list of sources
138
+ summary: Codename gem randomly generate codename based on list of names
138
139
  test_files: []
139
140