morning-pages 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,21 +1,12 @@
1
1
  require "bundler/gem_tasks"
2
- task :default => [:specs, 'cukes:fast', 'cukes:slow']
2
+ task :default => [:specs, :cukes]
3
3
 
4
4
  desc "Run unit tests"
5
5
  task :specs do
6
6
  sh "rspec spec"
7
7
  end
8
8
 
9
- namespace :cukes do
10
- desc "Run end-to-end tests"
11
- task :slow do
12
- ENV['SLOW'] = 'true'
13
- sh "cucumber"
14
- end
15
-
16
- desc "Run end-to-end tests with stubbed out file system for speed"
17
- task :fast do
18
- ENV['SLOW'] = nil
19
- sh "cucumber"
20
- end
9
+ desc "Run end-to-end tests"
10
+ task :cukes do
11
+ sh "cucumber"
21
12
  end
data/bin/morning-pages ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'trollop'
4
+
5
+ opts = Trollop.options do
6
+ opt :dir, "Words directory", :required => false, :type => :string, :default => "~/Documents/words"
7
+ end
8
+
9
+ todays_file = %{#{opts[:dir]}/#{Time.now.strftime("%Y\-%m\-%d")}}
10
+ system "$EDITOR #{todays_file}"
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ File.open(ARGV[0], 'w') do |file|
4
+ file.write "fake editor output"
5
+ end
@@ -0,0 +1,18 @@
1
+ require 'tmpdir'
2
+
3
+ When /^I run 'morning\-pages'$/ do
4
+ run "morning-pages -d #{@dir}"
5
+ end
6
+
7
+ Then /^I should be able to write my words$/ do
8
+ now = Time.now
9
+ check_exact_file_content "#{@dir}/#{Time.now.strftime("%Y\-%m\-%d")}", "fake editor output"
10
+ end
11
+
12
+ Before do
13
+ @dir = Dir.mktmpdir
14
+ end
15
+
16
+ After do
17
+ FileUtils.remove_entry_secure @dir
18
+ end
@@ -0,0 +1,17 @@
1
+ require 'aruba/api'
2
+ module MorningPages
3
+ module Testing
4
+ module EndToEndDriver
5
+ include Aruba::Api
6
+ end
7
+ end
8
+ end
9
+
10
+ ENV['PATH'] = [
11
+ File.expand_path(File.dirname(__FILE__) + '/../../bin'),
12
+ File.expand_path(File.dirname(__FILE__) + '/../../features/bin'),
13
+ ENV['PATH']
14
+ ].join File::PATH_SEPARATOR
15
+
16
+ ENV['EDITOR'] = 'fake-editor'
17
+ World(MorningPages::Testing::EndToEndDriver)
@@ -0,0 +1 @@
1
+ $: << File.dirname(__FILE__) + '/../../lib'
@@ -0,0 +1,8 @@
1
+ Feature: writing words
2
+ As Wilma the writer
3
+ I want to type morning-pages and be able to write my words for the day straightaway in my favourite editor
4
+ So nothing can distract me from getting them done
5
+
6
+ Scenario:
7
+ When I run 'morning-pages'
8
+ Then I should be able to write my words
@@ -1,3 +1,3 @@
1
1
  module MorningPages
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
21
  s.require_paths = ["lib"]
22
22
 
23
+ s.add_dependency 'trollop', '~> 1.16.2'
23
24
  s.add_development_dependency 'rspec', '~> 2.10.0'
24
25
  s.add_development_dependency 'rake', '~> 0.9.2.2'
25
26
  s.add_development_dependency 'cucumber', '~> 1.2'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: morning-pages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,6 +11,22 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2012-07-17 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: trollop
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 1.16.2
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 1.16.2
14
30
  - !ruby/object:Gem::Dependency
15
31
  name: rspec
16
32
  requirement: !ruby/object:Gem::Requirement
@@ -83,7 +99,8 @@ description: ! "I've long been fascinated by the morning pages habit of writing
83
99
  help` for more info."
84
100
  email:
85
101
  - chris.p@rsons.org
86
- executables: []
102
+ executables:
103
+ - morning-pages
87
104
  extensions: []
88
105
  extra_rdoc_files: []
89
106
  files:
@@ -92,6 +109,12 @@ files:
92
109
  - Gemfile
93
110
  - README.md
94
111
  - Rakefile
112
+ - bin/morning-pages
113
+ - features/bin/fake-editor
114
+ - features/step_definitions/steps.rb
115
+ - features/support/driver.rb
116
+ - features/support/env.rb
117
+ - features/writing_words.feature
95
118
  - lib/morning-pages.rb
96
119
  - lib/morning-pages/version.rb
97
120
  - morning-pages.gemspec
@@ -121,4 +144,9 @@ signing_key:
121
144
  specification_version: 3
122
145
  summary: Command line helper to write your morning pages
123
146
  test_files:
147
+ - features/bin/fake-editor
148
+ - features/step_definitions/steps.rb
149
+ - features/support/driver.rb
150
+ - features/support/env.rb
151
+ - features/writing_words.feature
124
152
  - spec/write_spec.rb