wordy 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -14,6 +14,8 @@ Usage
14
14
 
15
15
  Using wordy is easy. Here's the rundown in [irb](http://en.wikipedia.org/wiki/Interactive_Ruby_Shell):
16
16
 
17
+ # irb
18
+
17
19
  $ require 'wordy'
18
20
  => true
19
21
 
@@ -39,6 +41,17 @@ Using wordy is easy. Here's the rundown in [irb](http://en.wikipedia.org/wiki/In
39
41
  => "Aperiam ea voluptatem nostrum qui fuga et molestias quibusdam consequuntur non sed qui culpa. Incidunt minima similique repellendus distinctio debitis blanditiis ratione architecto.\n\nAliquid non excepturi voluptatem nobis laudantium. Corrupti ut aut autem sed quia ducimus eligendi eum maxime voluptas suscipit.\n\nDolor fuga est voluptas cupiditate vel quaerat consequuntur velit corrupti. Unde quod quia est nihil est nisi quo officiis nobis. Est similique ea dolorum natus. Odio voluptate facere cupiditate quo autem quod doloremque expedita delectus cum accusamus consequuntur ut.\n\nDignissimos quia blanditiis sit quis voluptates et optio maiores tenetur quia. Non aperiam quos eligendi voluptas est animi voluptatum sequi impedit. Impedit repudiandae officiis magni quia qui explicabo voluptas saepe delectus illo aliquid qui. Sunt minus sint quam omnis sed blanditiis."
40
42
 
41
43
 
44
+ New in version 1.1.0 is the wordy executable. Now you can get wordy from the command line.
45
+
46
+ # bash
47
+
48
+ $ wordy word
49
+ omnis
50
+
51
+ $ wordy sentence
52
+ Sunt vel quia delectus perferendis fugiat et quis fuga maxime magnam.
53
+
54
+
42
55
  That's it!
43
56
 
44
57
 
@@ -111,7 +124,7 @@ As usual, just use the `gem install` command:
111
124
 
112
125
  Or add wordy as a gem in your Gemfile:
113
126
 
114
- gem 'wordy', '~> 0.2.0'
127
+ gem 'wordy', '~> 1.1.0'
115
128
 
116
129
  Then run `bundle install`
117
130
 
@@ -0,0 +1,16 @@
1
+ #! /usr/bin/env ruby
2
+ # encoding: UTF-8
3
+
4
+ $:.push File.expand_path("../../lib", __FILE__)
5
+
6
+ require "wordy"
7
+
8
+ m = ARGV.shift || "body"
9
+ if m && Wordy.respond_to?(m)
10
+ puts Wordy.send(m)
11
+ elsif m == "-v"
12
+ puts "Wordy v#{Wordy::VERSION}"
13
+ else
14
+ puts "Wordy does not know #{m.inspect}. Please try one of the following..."
15
+ puts "=> word words sentence sentences paragraph paragraphs body"
16
+ end
@@ -1,3 +1,3 @@
1
1
  module Wordy
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -2,6 +2,8 @@ require 'minitest/autorun'
2
2
  require 'wordy'
3
3
 
4
4
  class TestWordy < MiniTest::Unit::TestCase
5
+
6
+ BIN = File.expand_path("../../bin/wordy", __FILE__)
5
7
 
6
8
  def test_has_version
7
9
  assert_equal String, Wordy::VERSION.class
@@ -91,4 +93,36 @@ class TestWordy < MiniTest::Unit::TestCase
91
93
  assert Wordy.body != Wordy.body
92
94
  end
93
95
 
96
+ def test_executable_exists
97
+ assert File.exists?(BIN)
98
+ end
99
+
100
+ def test_executable_is_executable
101
+ assert File.executable?(BIN)
102
+ end
103
+
104
+ def test_executable_returns_version
105
+ out = `#{BIN} -v`
106
+ assert_match "Wordy v#{Wordy::VERSION}", out
107
+ end
108
+
109
+ def test_executable_defaults_to_body
110
+ out = `#{BIN}`
111
+ assert_match /^([A-Z][a-z\s]+\.\s?){2,}$/, out
112
+ end
113
+
114
+ def test_executable_rejects_non_methods
115
+ %w(wordy werd poem).each do |m|
116
+ out = `#{BIN} #{m}`
117
+ assert out.match(/Wordy does not know/)
118
+ end
119
+ end
120
+
121
+ def test_executable_responds_to_methods
122
+ %w(word words sentence sentences paragraph paragraphs body).each do |m|
123
+ out = `#{BIN} #{m}`
124
+ assert out.match(/Wordy does not know/).nil?
125
+ end
126
+ end
127
+
94
128
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: wordy
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.0
5
+ version: 1.1.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Spencer Steffen
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-11-05 00:00:00 Z
13
+ date: 2011-11-07 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -37,8 +37,8 @@ dependencies:
37
37
  description: Written to help us create sample data for our applications, Wordy speaks in lorem ipsum. You can ask Wordy for paragraphs, sentences or words. Please see documentation for more information.
38
38
  email:
39
39
  - spencer@citrusme.com
40
- executables: []
41
-
40
+ executables:
41
+ - wordy
42
42
  extensions: []
43
43
 
44
44
  extra_rdoc_files: []
@@ -50,6 +50,7 @@ files:
50
50
  - LICENSE
51
51
  - README.md
52
52
  - Rakefile
53
+ - bin/wordy
53
54
  - lib/wordy.rb
54
55
  - lib/wordy/version.rb
55
56
  - test/test_wordy.rb