wedding_on_rails 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0424c8304c40d402a85b65fb42388efc27265c0c
4
+ data.tar.gz: f5b63f63900c30ccf20667c620b8892a923b6635
5
+ SHA512:
6
+ metadata.gz: abe1f99f2de19af6795d357c457ddda2c5c554c65f64ad51a7cfc30e5d3b8c34913f8ec1eb7bec643ebd74615eb2c4263c084f0ab3d11a38ee02722f7bcedb98
7
+ data.tar.gz: 6fa77b2db811c9b0d94d8fcbb278af770c90cb7afa6c4f5b94c8fb37364745ac5cb0474cd8598a64b02ef68810b3e1950748305cf09f6b3939487a3fc3f99e77
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_JOBS: 8
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
@@ -0,0 +1,50 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ wedding_on_rails (0.0.1)
5
+ commander (= 4.3.0)
6
+ gli (= 2.13.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ aruba (0.6.2)
12
+ childprocess (>= 0.3.6)
13
+ cucumber (>= 1.1.1)
14
+ rspec-expectations (>= 2.7.0)
15
+ builder (3.2.2)
16
+ childprocess (0.5.5)
17
+ ffi (~> 1.0, >= 1.0.11)
18
+ commander (4.3.0)
19
+ highline (~> 1.6.11)
20
+ cucumber (1.3.19)
21
+ builder (>= 2.1.2)
22
+ diff-lcs (>= 1.1.3)
23
+ gherkin (~> 2.12)
24
+ multi_json (>= 1.7.5, < 2.0)
25
+ multi_test (>= 0.1.2)
26
+ diff-lcs (1.2.5)
27
+ ffi (1.9.6)
28
+ gherkin (2.12.2)
29
+ multi_json (~> 1.3)
30
+ gli (2.13.0)
31
+ highline (1.6.21)
32
+ json (1.8.2)
33
+ multi_json (1.11.0)
34
+ multi_test (0.1.2)
35
+ rake (10.4.2)
36
+ rdoc (4.2.0)
37
+ json (~> 1.4)
38
+ rspec-expectations (3.2.0)
39
+ diff-lcs (>= 1.2.0, < 2.0)
40
+ rspec-support (~> 3.2.0)
41
+ rspec-support (3.2.2)
42
+
43
+ PLATFORMS
44
+ ruby
45
+
46
+ DEPENDENCIES
47
+ aruba
48
+ rake
49
+ rdoc
50
+ wedding_on_rails!
@@ -0,0 +1,6 @@
1
+ = wedding_on_rails
2
+
3
+ Describe your project here
4
+
5
+ :include:wedding_on_rails.rdoc
6
+
@@ -0,0 +1,44 @@
1
+ require 'rake/clean'
2
+ require 'rubygems'
3
+ require 'rubygems/package_task'
4
+ require 'rdoc/task'
5
+ require 'cucumber'
6
+ require 'cucumber/rake/task'
7
+ Rake::RDocTask.new do |rd|
8
+ rd.main = "README.rdoc"
9
+ rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
10
+ rd.title = 'Your application title'
11
+ end
12
+
13
+ spec = eval(File.read('wedding_on_rails.gemspec'))
14
+
15
+ Gem::PackageTask.new(spec) do |pkg|
16
+ end
17
+ CUKE_RESULTS = 'results.html'
18
+ CLEAN << CUKE_RESULTS
19
+ desc 'Run features'
20
+ Cucumber::Rake::Task.new(:features) do |t|
21
+ opts = "features --format html -o #{CUKE_RESULTS} --format progress -x"
22
+ opts += " --tags #{ENV['TAGS']}" if ENV['TAGS']
23
+ t.cucumber_opts = opts
24
+ t.fork = false
25
+ end
26
+
27
+ desc 'Run features tagged as work-in-progress (@wip)'
28
+ Cucumber::Rake::Task.new('features:wip') do |t|
29
+ tag_opts = ' --tags ~@pending'
30
+ tag_opts = ' --tags @wip'
31
+ t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty -x -s#{tag_opts}"
32
+ t.fork = false
33
+ end
34
+
35
+ task :cucumber => :features
36
+ task 'cucumber:wip' => 'features:wip'
37
+ task :wip => 'features:wip'
38
+ require 'rake/testtask'
39
+ Rake::TestTask.new do |t|
40
+ t.libs << "test"
41
+ t.test_files = FileList['test/*_test.rb']
42
+ end
43
+
44
+ task :default => [:test,:features]
@@ -0,0 +1,132 @@
1
+ #!/usr/bin/env ruby
2
+ require 'gli'
3
+ require 'commander'
4
+ require 'net/http'
5
+ require 'json'
6
+
7
+ begin # XXX: Remove this begin/rescue before distributing your app
8
+ require 'wedding_on_rails'
9
+ rescue LoadError
10
+ STDERR.puts "In development, you need to use `bundle exec bin/wedding_on_rails` to run your app"
11
+ STDERR.puts "At install-time, RubyGems will make sure lib, etc. are in the load path"
12
+ STDERR.puts "Feel free to remove this message from bin/wedding_on_rails now"
13
+ exit 64
14
+ end
15
+
16
+ include GLI::App
17
+
18
+ program_desc 'Describe your application here'
19
+
20
+ version WeddingOnRails::VERSION
21
+
22
+ subcommand_option_handling :normal
23
+ arguments :strict
24
+
25
+ desc 'Describe some switch here'
26
+ switch [:s,:switch]
27
+
28
+ desc 'Describe some flag here'
29
+ default_value 'the default'
30
+ arg_name 'The name of the argument'
31
+ flag [:f,:flagname]
32
+
33
+ desc 'Describe rsvp here'
34
+ arg_name 'Describe arguments to rsvp here'
35
+ command :rsvp do |c|
36
+ c.desc 'Describe a switch to rsvp'
37
+ c.switch :s
38
+
39
+ c.desc 'Describe a flag to rsvp'
40
+ c.default_value 'default'
41
+ c.flag :f
42
+ c.action do |global_options,options,args|
43
+
44
+ uri = URI('http://hitched.it/events/1/groups/1/guests')
45
+ http = Net::HTTP.new(uri.host, uri.port)
46
+ req = Net::HTTP::Get.new(uri)
47
+ guests = JSON.parse(http.request(req).body)
48
+
49
+ name = ask("What is your full name?")
50
+
51
+ guests = guests.select do |guest|
52
+ guest["name"].downcase == name.downcase
53
+ end
54
+
55
+ if guests.empty?
56
+ raise "Sorry I couldn't find you :("
57
+ else
58
+ guest = guests.first
59
+ end
60
+
61
+ message = "Would you like to change your RSVP?"
62
+
63
+ if guest["rsvp"].nil?
64
+ rsvp = "Not yet RSVP'd"
65
+ message = "RSVP now?"
66
+ elsif guest["rsvp"]
67
+ rsvp = "Yes ^_^"
68
+ else
69
+ rsvp = "No"
70
+ end
71
+
72
+ puts "\n Hi #{guest["name"]}! Your current RSVP is: #{rsvp}\n\n"
73
+
74
+ puts message
75
+ will_rsvp = choose(:yes, :no)
76
+
77
+ puts "\n"
78
+
79
+ new_rsvp = false
80
+
81
+ if will_rsvp == :yes
82
+ choose do |menu|
83
+ menu.choice("Yes I'd love to come") { new_rsvp = true }
84
+ menu.choices("No sorry I can't make it") { new_rsvp = false }
85
+ end
86
+
87
+ uri = URI('http://hitched.it/events/1/groups/1/guests/1')
88
+ http = Net::HTTP.new(uri.host, uri.port)
89
+ data = { "guest[rsvp]" => new_rsvp }
90
+ body = URI.encode_www_form(data)
91
+ req = Net::HTTP::Put.new(uri)
92
+ req.body = body
93
+ res = http.request(req)
94
+
95
+ if res.code == "200"
96
+ puts "\nAll updated: ^_^"
97
+ else
98
+ puts "\nSomething went wrong (#{res.code})"
99
+ end
100
+ end
101
+
102
+ # # Your command logic here
103
+
104
+ # # If you have any errors, just raise them
105
+ # # raise "that command made no sense"
106
+
107
+ # puts "rsvp command ran"
108
+ end
109
+ end
110
+
111
+ pre do |global,command,options,args|
112
+ # Pre logic here
113
+ # Return true to proceed; false to abort and not call the
114
+ # chosen command
115
+ # Use skips_pre before a command to skip this block
116
+ # on that command only
117
+ true
118
+ end
119
+
120
+ post do |global,command,options,args|
121
+ # Post logic here
122
+ # Use skips_post before a command to skip this
123
+ # block on that command only
124
+ end
125
+
126
+ on_error do |exception|
127
+ # Error logic here
128
+ # return false to skip default error handling
129
+ true
130
+ end
131
+
132
+ exit run(ARGV)
@@ -0,0 +1,6 @@
1
+ When /^I get help for "([^"]*)"$/ do |app_name|
2
+ @app_name = app_name
3
+ step %(I run `#{app_name} help`)
4
+ end
5
+
6
+ # Add more step definitions here
@@ -0,0 +1,15 @@
1
+ require 'aruba/cucumber'
2
+
3
+ ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
4
+ LIB_DIR = File.join(File.expand_path(File.dirname(__FILE__)),'..','..','lib')
5
+
6
+ Before do
7
+ # Using "announce" causes massive warnings on 1.9.2
8
+ @puts = true
9
+ @original_rubylib = ENV['RUBYLIB']
10
+ ENV['RUBYLIB'] = LIB_DIR + File::PATH_SEPARATOR + ENV['RUBYLIB'].to_s
11
+ end
12
+
13
+ After do
14
+ ENV['RUBYLIB'] = @original_rubylib
15
+ end
@@ -0,0 +1,8 @@
1
+ Feature: My bootstrapped app kinda works
2
+ In order to get going on coding my awesome app
3
+ I want to have aruba and cucumber setup
4
+ So I don't have to do it myself
5
+
6
+ Scenario: App just runs
7
+ When I get help for "wedding_on_rails"
8
+ Then the exit status should be 0
@@ -0,0 +1,4 @@
1
+ require 'wedding_on_rails/version.rb'
2
+
3
+ # Add requires for other files you add to your project here, so
4
+ # you just need to require this one file in your bin file
@@ -0,0 +1,3 @@
1
+ module WeddingOnRails
2
+ VERSION = '0.0.1'
3
+ end
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+
3
+ class DefaultTest < Test::Unit::TestCase
4
+
5
+ def setup
6
+ end
7
+
8
+ def teardown
9
+ end
10
+
11
+ def test_the_truth
12
+ assert true
13
+ end
14
+ end
@@ -0,0 +1,9 @@
1
+ require 'test/unit'
2
+
3
+ # Add test libraries you want to use here, e.g. mocha
4
+
5
+ class Test::Unit::TestCase
6
+
7
+ # Add global extensions to the test case class here
8
+
9
+ end
@@ -0,0 +1,24 @@
1
+ # Ensure we require the local version and not one we might have installed already
2
+ require File.join([File.dirname(__FILE__),'lib','wedding_on_rails','version.rb'])
3
+ spec = Gem::Specification.new do |s|
4
+ s.name = 'wedding_on_rails'
5
+ s.version = WeddingOnRails::VERSION
6
+ s.author = 'Adam Butler'
7
+ s.email = 'adam@lab.io'
8
+ s.homepage = 'http://lab.io'
9
+ s.platform = Gem::Platform::RUBY
10
+ s.summary = 'A gem for to RSVP to my wedding'
11
+ s.files = `git ls-files`.split("
12
+ ")
13
+ s.require_paths << 'lib'
14
+ s.has_rdoc = true
15
+ s.extra_rdoc_files = ['README.rdoc','wedding_on_rails.rdoc']
16
+ s.rdoc_options << '--title' << 'wedding_on_rails' << '--main' << 'README.rdoc' << '-ri'
17
+ s.bindir = 'bin'
18
+ s.executables << 'wedding_on_rails'
19
+ s.add_development_dependency('rake')
20
+ s.add_development_dependency('rdoc')
21
+ s.add_development_dependency('aruba')
22
+ s.add_runtime_dependency('gli','2.13.0')
23
+ s.add_runtime_dependency('commander','4.3.0')
24
+ end
@@ -0,0 +1,5 @@
1
+ = wedding_on_rails
2
+
3
+ Generate this with
4
+ wedding_on_rails rdoc
5
+ After you have described your command line interface
metadata ADDED
@@ -0,0 +1,136 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: wedding_on_rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Adam Butler
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rdoc
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: aruba
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: gli
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 2.13.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 2.13.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: commander
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '='
74
+ - !ruby/object:Gem::Version
75
+ version: 4.3.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '='
81
+ - !ruby/object:Gem::Version
82
+ version: 4.3.0
83
+ description:
84
+ email: adam@lab.io
85
+ executables:
86
+ - wedding_on_rails
87
+ extensions: []
88
+ extra_rdoc_files:
89
+ - README.rdoc
90
+ - wedding_on_rails.rdoc
91
+ files:
92
+ - ".bundle/config"
93
+ - Gemfile
94
+ - Gemfile.lock
95
+ - README.rdoc
96
+ - Rakefile
97
+ - bin/wedding_on_rails
98
+ - features/step_definitions/wedding_on_rails_steps.rb
99
+ - features/support/env.rb
100
+ - features/wedding_on_rails.feature
101
+ - lib/wedding_on_rails.rb
102
+ - lib/wedding_on_rails/version.rb
103
+ - test/default_test.rb
104
+ - test/test_helper.rb
105
+ - wedding_on_rails.gemspec
106
+ - wedding_on_rails.rdoc
107
+ homepage: http://lab.io
108
+ licenses: []
109
+ metadata: {}
110
+ post_install_message:
111
+ rdoc_options:
112
+ - "--title"
113
+ - wedding_on_rails
114
+ - "--main"
115
+ - README.rdoc
116
+ - "-ri"
117
+ require_paths:
118
+ - lib
119
+ - lib
120
+ required_ruby_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ required_rubygems_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ requirements: []
131
+ rubyforge_project:
132
+ rubygems_version: 2.2.2
133
+ signing_key:
134
+ specification_version: 4
135
+ summary: A gem for to RSVP to my wedding
136
+ test_files: []