frank 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -100,6 +100,10 @@ This will return 3 sentences of standard [Lorem Ipsum][11]. `lorem` also has all
100
100
  lorem.word
101
101
  lorem.paragraphs 10
102
102
  lorem.paragraph
103
+ lorem.name
104
+ lorem.first_name
105
+ lorem.last_name
106
+ lorem.email
103
107
 
104
108
 
105
109
  ### Placeholder Images
data/Rakefile CHANGED
@@ -1,9 +1,12 @@
1
+ require File.dirname(__FILE__) + "/lib/frank.rb"
2
+
1
3
  begin
2
4
  require 'jeweler'
3
5
  Jeweler::Tasks.new do |gemspec|
4
6
  gemspec.name = "frank"
5
7
  gemspec.summary = "Stupidly Simple Static Slinger"
6
8
  gemspec.description = "Create/Dump static builds using whatever templating/helper languages you wish"
9
+ gemspec.version = Frank::VERSION
7
10
  gemspec.email = "travis.dunn@thisismedium.com"
8
11
  gemspec.homepage = "http://github.com/blahed/frank"
9
12
  gemspec.authors = ["blahed", "nwah"]
data/bin/frank CHANGED
@@ -5,6 +5,9 @@ if ARGV.empty?
5
5
  puts "Usage: frank [PROJECT_NAME]"
6
6
  puts "Stubs out a template project"
7
7
  exit
8
+ elsif ['-v', '--version'].include?(ARGV.first)
9
+ puts "Frank v#{Frank::VERSION}"
10
+ exit
8
11
  end
9
12
 
10
13
  Frank.stub(ARGV.first)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{frank}
8
- s.version = "0.2.2"
8
+ s.version = "0.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["blahed", "nwah"]
12
- s.date = %q{2010-03-05}
12
+ s.date = %q{2010-03-11}
13
13
  s.description = %q{Create/Dump static builds using whatever templating/helper languages you wish}
14
14
  s.email = %q{travis.dunn@thisismedium.com}
15
15
  s.executables = ["frank", "frankout", "frankup"]
@@ -22,7 +22,6 @@ Gem::Specification.new do |s|
22
22
  "LICENSE",
23
23
  "README.md",
24
24
  "Rakefile",
25
- "VERSION",
26
25
  "bin/frank",
27
26
  "bin/frankout",
28
27
  "bin/frankup",
@@ -5,6 +5,7 @@ require 'frank/statik'
5
5
  require 'frank/imager'
6
6
 
7
7
  module Frank
8
+ VERSION = '0.2.3'
8
9
 
9
10
  module Render; end
10
11
 
@@ -33,6 +33,34 @@ module Frank
33
33
  sentences(randm(3..7)).capitalize
34
34
  end.join("\n\n")
35
35
  end
36
+
37
+ def date(fmt='%a %b %d, %Y')
38
+ y = rand(20) + 1990
39
+ m = rand(12) + 1
40
+ d = rand(31) + 1
41
+ Time.local(y,m,d).strftime(fmt)
42
+ end
43
+
44
+ def name
45
+ "#{first_name} #{last_name}"
46
+ end
47
+
48
+ def first_name
49
+ names = %w(Judith Angelo Margarita Kerry Elaine Lorenzo Justice Doris Raul Liliana Kerry Elise Ciaran Johnny Moses Davion Penny Mohammed Harvey Sheryl Hudson Brendan Brooklynn Denis Sadie Trisha Jacquelyn Virgil Cindy Alexa Marianne Giselle Casey Alondra Angela Katherine Skyler Kyleigh Carly Abel Adrianna Luis Dominick Eoin Noel Ciara Roberto Skylar Brock Earl Dwayne Jackie Hamish Sienna Nolan Daren Jean Shirley Connor Geraldine Niall Kristi Monty Yvonne Tammie Zachariah Fatima Ruby Nadia Anahi Calum Peggy Alfredo Marybeth Bonnie Gordon Cara John Staci Samuel Carmen Rylee Yehudi Colm Beth Dulce Darius inley Javon Jason Perla Wayne Laila Kaleigh Maggie Don Quinn Collin Aniya Zoe Isabel Clint Leland Esmeralda Emma Madeline Byron Courtney Vanessa Terry Antoinette George Constance Preston Rolando Caleb Kenneth Lynette Carley Francesca Johnnie Jordyn Arturo Camila Skye Guy Ana Kaylin Nia Colton Bart Brendon Alvin Daryl Dirk Mya Pete Joann Uriel Alonzo Agnes Chris Alyson Paola Dora Elias Allen Jackie Eric Bonita Kelvin Emiliano Ashton Kyra Kailey Sonja Alberto Ty Summer Brayden Lori Kelly Tomas Joey Billie Katie Stephanie Danielle Alexis Jamal Kieran Lucinda Eliza Allyson Melinda Alma Piper Deana Harriet Bryce Eli Jadyn Rogelio Orlaith Janet Randal Toby Carla Lorie Caitlyn Annika Isabelle inn Ewan Maisie Michelle Grady Ida Reid Emely Tricia Beau Reese Vance Dalton Lexi Rafael Makenzie Mitzi Clinton Xena Angelina Kendrick Leslie Teddy Jerald Noelle Neil Marsha Gayle Omar Abigail Alexandra Phil Andre Billy Brenden Bianca Jared Gretchen Patrick Antonio Josephine Kyla Manuel Freya Kellie Tonia Jamie Sydney Andres Ruben Harrison Hector Clyde Wendell Kaden Ian Tracy Cathleen Shawn)
50
+ names[rand(names.size)]
51
+ end
52
+
53
+ def last_name
54
+ names = %w(Chung Chen Melton Hill Puckett Song Hamilton Bender Wagner McLaughlin McNamara Raynor Moon Woodard Desai Wallace Lawrence Griffin Dougherty Powers May Steele Teague Vick Gallagher Solomon Walsh Monroe Connolly Hawkins Middleton Goldstein Watts Johnston Weeks Wilkerson Barton Walton Hall Ross Chung Bender Woods Mangum Joseph Rosenthal Bowden Barton Underwood Jones Baker Merritt Cross Cooper Holmes Sharpe Morgan Hoyle Allen Rich Rich Grant Proctor Diaz Graham Watkins Hinton Marsh Hewitt Branch Walton O'Brien Case Watts Christensen Parks Hardin Lucas Eason Davidson Whitehead Rose Sparks Moore Pearson Rodgers Graves Scarborough Sutton Sinclair Bowman Olsen Love McLean Christian Lamb James Chandler Stout Cowan Golden Bowling Beasley Clapp Abrams Tilley Morse Boykin Sumner Cassidy Davidson Heath Blanchard McAllister McKenzie Byrne Schroeder Griffin Gross Perkins Robertson Palmer Brady Rowe Zhang Hodge Li Bowling Justice Glass Willis Hester Floyd Graves Fischer Norman Chan Hunt Byrd Lane Kaplan Heller May Jennings Hanna Locklear Holloway Jones Glover Vick O'Donnell Goldman McKenna Starr Stone McClure Watson Monroe Abbott Singer Hall Farrell Lucas Norman Atkins Monroe Robertson Sykes Reid Chandler Finch Hobbs Adkins Kinney Whitaker Alexander Conner Waters Becker Rollins Love Adkins Black Fox Hatcher Wu Lloyd Joyce Welch Matthews Chappell MacDonald Kane Butler Pickett Bowman Barton Kennedy Branch Thornton McNeill Weinstein Middleton Moss Lucas Rich Carlton Brady Schultz Nichols Harvey Stevenson Houston Dunn West O'Brien Barr Snyder Cain Heath Boswell Olsen Pittman Weiner Petersen Davis Coleman Terrell Norman Burch Weiner Parrott Henry Gray Chang McLean Eason Weeks Siegel Puckett Heath Hoyle Garrett Neal Baker Goldman Shaffer Choi Carver)
55
+ names[rand(names.size)]
56
+ end
57
+
58
+ def email
59
+ delimiters = ['_','-','']
60
+ domains = %w(gmail.com yahoo.com hotmail.com email.com live.com me.com mac.com aol.com fastmail.com mail.com)
61
+ username = name.gsub(/[^\w]/, delimiters[rand(delimiters.size)])
62
+ "#{username}@#{domains[rand(domains.size)]}".downcase
63
+ end
36
64
 
37
65
  def image(width, height, random=false)
38
66
  if defined? MiniMagick
@@ -11,6 +11,7 @@ require 'rack/test'
11
11
  require 'shoulda'
12
12
  require 'template/helpers'
13
13
  require 'frank'
14
+ require 'ruby-debug'
14
15
 
15
16
  module Kernel
16
17
  def capture_stdout
@@ -1,4 +1,7 @@
1
1
  %p.words= lorem.words 3
2
2
  %p.sentences= lorem.sentences 2
3
3
  %p.paragraphs= lorem.paragraphs 1
4
+ %p.date= lorem.date('%Y-%m-%d')
5
+ %p.name= lorem.name
6
+ %p.email= lorem.email
4
7
  %img{:src => lorem.image(400, 300, true)}
@@ -41,6 +41,24 @@ class TestBase < Test::Unit::TestCase
41
41
  assert_match reg, template
42
42
  end
43
43
 
44
+ should 'render haml with lorem name' do
45
+ template = @frank.render_path('lorem_test.haml')
46
+ reg = /<p class='name'>\w+\s\w+<\/p>/m
47
+ assert_match reg, template
48
+ end
49
+
50
+ should 'render haml with lorem email' do
51
+ template = @frank.render_path('lorem_test.haml')
52
+ reg = /<p class='email'>[\w-]+@\w+\.\w+<\/p>/m
53
+ assert_match reg, template
54
+ end
55
+
56
+ should 'render haml with lorem date' do
57
+ template = @frank.render_path('lorem_test.haml')
58
+ reg = /<p class='date'>\d{4}-\d{2}-\d{2}<\/p>/m
59
+ assert_match reg, template
60
+ end
61
+
44
62
  should 'render image url using imager' do
45
63
  template = @frank.render_path('lorem_test.haml')
46
64
  reg = /<img src='\/_img\/400x300.jpg\?random\d{5}' \/>/
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frank
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - blahed
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-03-05 00:00:00 -05:00
13
+ date: 2010-03-11 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -79,7 +79,6 @@ files:
79
79
  - LICENSE
80
80
  - README.md
81
81
  - Rakefile
82
- - VERSION
83
82
  - bin/frank
84
83
  - bin/frankout
85
84
  - bin/frankup
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.2.2