phil 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -3
  3. data/lib/phil.rb +11 -5
  4. data/lib/phil/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a097c29022da4d95864025def83c24f921fbdec6
4
- data.tar.gz: d0d9c026d74181fb0f0dae4f6c787620706132f5
3
+ metadata.gz: 7f1ea879b9f4c1d6e19afe9ec993fcf2aa57d9f0
4
+ data.tar.gz: 9f4bc43a1fe0cfb1988edc28fc6d7d9e807729e5
5
5
  SHA512:
6
- metadata.gz: 01f07b15c56601616045ae7ea1923520006552701b0f31d1e6b92a124a7f899e507dd4d07be9bdd1a013c18766446268f4c37f72182ca58405415ab48a9368cf
7
- data.tar.gz: 2fad59da69815f4b515c9d99c1045371b0f326355bfcb4070a8ef6275b9e213260eb7e6769ea0afccfc2d1ee132b73f0ced53bea12a3ab016cde4103483ecea7
6
+ metadata.gz: e258cd1fe0470d475ae0d37278fae13a23c0ecc5f317e5b9df38669a0d11298e891f76b725faabf5c89433276f26ed4aac966a29eb57f47191e4b25ae7ca5592
7
+ data.tar.gz: b85c432d4fd1799c566387ab3402a6f7f486e277197fa0b0e203a12f12df3c56739abbb68d9e94b3ae9fbc9f7c9a220d6ee248d01a1b1b212f852369c21148ae
data/README.md CHANGED
@@ -39,11 +39,11 @@ Phil.sometimes 100 do
39
39
 
40
40
  Generate a ton of body content with one method. This defaults to
41
41
  `"h1 p p h2 p ol h2 p ul"`, but you can pass it a string of whatever content tags you like,
42
- including `blockquote`, other headings, and so on. Blockquotes will contain multiple `<p>` elements, paragraphs will contain a few sentences, and most other tags will contain 3-15 words.
42
+ including `blockquote`, other headings, and so on. Blockquotes will contain multiple `<p>` elements, paragraphs will contain a few sentences, and any other tags will contain 3-15 words.
43
43
 
44
44
  ```ruby
45
- Phil.body_content
46
- Phil.body_content "h1 p h2 ul p blockquote h5 h6"
45
+ Phil.markup
46
+ Phil.markup "h1 p h2 ul p blockquote h5 h6"
47
47
  ```
48
48
 
49
49
  ### Lorem methods (all take ranges or numbers)
@@ -83,6 +83,7 @@ Phil.number 5 # Random 5-digit number (string)
83
83
  ### Aliased Ffaker methods for convenience
84
84
 
85
85
  ```ruby
86
+ Phil.city
86
87
  Phil.domain_name
87
88
  Phil.email
88
89
  Phil.name
data/lib/phil.rb CHANGED
@@ -49,7 +49,7 @@ module Phil
49
49
  build_tag "ul", build_tags("li", -> { "<a href='#'>#{words(item_length)}</a>" }, list_items)
50
50
  end
51
51
 
52
- def body_content(pattern="h1 p p h2 p ol h2 p ul")
52
+ def markup(pattern="h1 p p h2 p ol h2 p ul")
53
53
  pattern.split(" ").map{ |t| tag(t) }.join.html_safe
54
54
  end
55
55
 
@@ -62,11 +62,19 @@ module Phil
62
62
  (1..length).map { rand(10) }.join
63
63
  end
64
64
 
65
+ def phone(format = "(###) ###-####")
66
+ format.gsub(/#/) { rand(9) + 1 }
67
+ end
68
+
65
69
  def date(day_window = nil)
66
70
  t = Time.now.to_f
67
71
  Time.at(day_window ? t - rand * day_window * 86400 : t * rand)
68
72
  end
69
73
 
74
+ def city
75
+ Faker::Address.city
76
+ end
77
+
70
78
  def domain_name
71
79
  Faker::Internet.domain_name
72
80
  end
@@ -87,10 +95,6 @@ module Phil
87
95
  Faker::Name.name
88
96
  end
89
97
 
90
- def phone(format = "(###) ###-####")
91
- format.gsub(/#/) { rand(9) + 1 }
92
- end
93
-
94
98
  def state
95
99
  Faker::AddressUS.state
96
100
  end
@@ -99,6 +103,8 @@ module Phil
99
103
  Faker::AddressUS.state_abbr
100
104
  end
101
105
 
106
+ alias_method :body_content, :markup
107
+
102
108
  private
103
109
 
104
110
  def tag(name, content = nil, children = nil)
data/lib/phil/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Phil
2
- VERSION = '0.9.1'
2
+ VERSION = '0.9.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Daigle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-13 00:00:00.000000000 Z
11
+ date: 2013-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffaker