tddium-preview 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tddium-preview (0.9.0)
4
+ tddium-preview (0.9.3)
5
5
  bundler
6
6
  highline
7
7
  json
@@ -12,7 +12,7 @@ PATH
12
12
  GEM
13
13
  remote: http://rubygems.org/
14
14
  specs:
15
- antilles (0.1.3)
15
+ antilles (0.1.4)
16
16
  bundler
17
17
  daemons
18
18
  httparty
@@ -29,7 +29,6 @@ GEM
29
29
  builder (3.0.0)
30
30
  childprocess (0.2.2)
31
31
  ffi (~> 1.0.6)
32
- crack (0.1.8)
33
32
  cucumber (1.0.2)
34
33
  builder (>= 2.1.2)
35
34
  diff-lcs (>= 1.1.2)
@@ -43,19 +42,22 @@ GEM
43
42
  gherkin (2.4.21)
44
43
  json (>= 1.4.6)
45
44
  highline (1.6.2)
46
- httparty (0.7.8)
47
- crack (= 0.1.8)
45
+ httparty (0.8.0)
46
+ multi_json
47
+ multi_xml
48
48
  json (1.6.1)
49
49
  mimic (0.4.3)
50
50
  json
51
51
  plist
52
52
  rack
53
53
  sinatra
54
+ multi_json (1.0.3)
55
+ multi_xml (0.4.1)
54
56
  pickle (0.4.8)
55
57
  cucumber (>= 0.8)
56
58
  rake
57
59
  plist (3.1.0)
58
- rack (1.3.2)
60
+ rack (1.3.3)
59
61
  rake (0.9.2)
60
62
  rdiscount (1.6.8)
61
63
  rspec (2.6.0)
data/bin/tddium CHANGED
@@ -4,7 +4,7 @@
4
4
  #
5
5
 
6
6
  require 'yaml'
7
- YAML::ENGINE.yamler = 'syck'
7
+ YAML::ENGINE.yamler = 'syck' if defined?(YAML::ENGINE)
8
8
 
9
9
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
10
10
  require "tddium"
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2011 Solano Labs All Rights Reserved
2
+
1
3
  @mimic
2
4
  Feature: Account command
3
5
  As a Tddium user
@@ -71,4 +73,3 @@ Feature: Account command
71
73
  """
72
74
  tddium must be initialized. Try 'tddium login'
73
75
  """
74
-
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2011 Solano Labs All Rights Reserved
2
+
1
3
  @mimic
2
4
  Feature: Activate command
3
5
  As a Tddium user
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2011 Solano Labs All Rights Reserved
2
+
1
3
  @mimic
2
4
  Feature: Login command
3
5
 
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2011 Solano Labs All Rights Reserved
2
+
1
3
  @mimic
2
4
  Feature: Logout Command
3
5
 
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2011 Solano Labs All Rights Reserved
2
+
1
3
  Given /^the user has the following memberships in his account:$/ do |table|
2
4
  Antilles.install(:get, "/1/memberships", {:status=>0, :memberships=>table.hashes})
3
5
  @memberships = {}
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2011 Solano Labs All Rights Reserved
2
+
1
3
  Given /^"([^"]*)" is a valid invitation token$/ do |arg1|
2
4
  Antilles.install(:post, "/1/users", SAMPLE_USER_RESPONSE, :code=>201)
3
5
  end
@@ -1,3 +1,4 @@
1
+ # Copyright (c) 2011 Solano Labs All Rights Reserved
1
2
 
2
3
  When /^the console session ends$/ do
3
4
  @last_exit_status = @interactive.stop(true)
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2011 Solano Labs All Rights Reserved
2
+
1
3
  Given /^the user is logged in$/ do
2
4
  @api_key = "abcdef"
3
5
  Antilles.install(:get, "/1/users", SAMPLE_USER_RESPONSE)
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2011 Solano Labs All Rights Reserved
2
+
1
3
  Given /^the command is "([^"]*)"$/ do |command|
2
4
  @command = command
3
5
  end
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2011 Solano Labs All Rights Reserved
2
+
1
3
  def make_suite_response(name, branch)
2
4
  suite = SAMPLE_SUITE_RESPONSE
3
5
  suite["repo_name"] = name
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2011 Solano Labs All Rights Reserved
2
+
1
3
  @mimic
2
4
  Feature: suite command
3
5
  As a user
@@ -43,6 +45,3 @@ Feature: suite command
43
45
  Then the output from "tddium suite" should contain "Created suite..."
44
46
  When the console session ends
45
47
  Then the exit status should be 0
46
-
47
-
48
-
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2011 Solano Labs All Rights Reserved
2
+
1
3
  Before do
2
4
  @aruba_timeout_seconds = 10
3
5
  @aruba_io_wait_seconds = 2
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2011 Solano Labs All Rights Reserved
2
+
1
3
  require 'aruba/api'
2
4
 
3
5
  SAMPLE_API_KEY = "afb12412bdafe124124asfasfabebafeabwbawf1312342erbfasbb"
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2011 Solano Labs All Rights Reserved
2
+
1
3
  require 'rubygems'
2
4
  require 'aruba/cucumber'
3
5
  require 'pickle/parser'
@@ -2,8 +2,7 @@
2
2
 
3
3
  require 'antilles/cucumber'
4
4
 
5
- tid = ENV['TDDIUM_TID'] || 0
6
- port = 8500 + tid.to_i
5
+ port = Antilles.find_available_port
7
6
  ENV['TDDIUM_CLIENT_PORT'] = port.to_s
8
7
  ENV['TDDIUM_CLIENT_ENVIRONMENT'] = 'mimic'
9
8
 
data/lib/tddium.rb CHANGED
@@ -92,7 +92,8 @@ class Tddium < Thor
92
92
  write_api_key(new_user["user"]["api_key"])
93
93
  role = new_user["user"]["account_role"]
94
94
  if role.nil? || role == "owner"
95
- say Text::Process::ACCOUNT_CREATED % [new_user["user"]["email"], new_user["user"]["recurly_url"]]
95
+ u = new_user["user"]
96
+ say Text::Process::ACCOUNT_CREATED % [u["email"], u["trial_remaining"], u["recurly_url"]]
96
97
  else
97
98
  say Text::Process::ACCOUNT_ADDED % [new_user["user"]["email"], new_user["user"]["account_role"], new_user["user"]["account"]]
98
99
  end
@@ -432,9 +433,13 @@ class Tddium < Thor
432
433
 
433
434
  def call_api(method, api_path, params = {}, api_key = nil, show_error = true)
434
435
  api_key = tddium_settings(:fail_with_message => false)["api_key"] if tddium_settings(:fail_with_message => false) && api_key != false
436
+ params[:tddium_gem_version] = TddiumVersion::VERSION
435
437
  begin
436
438
  result = tddium_client.call_api(method, api_path, params, api_key)
437
439
  rescue TddiumClient::Error::Base => e
440
+
441
+ exit_failure e.message if e.status == Api::ErrorCode::GEM_OUT_OF_DATE
442
+
438
443
  say e.message if show_error
439
444
  raise e
440
445
  end
@@ -581,6 +586,15 @@ class Tddium < Thor
581
586
  message.nil?
582
587
  end
583
588
 
589
+ def git_root
590
+ root = `git rev-parse --show-toplevel 2>&1`
591
+ if $?.exitstatus == 0 then
592
+ root.chomp! if root
593
+ return root
594
+ end
595
+ return Dir.pwd
596
+ end
597
+
584
598
  def git_origin_url
585
599
  result = `(git config --get remote.origin.url || echo GIT_FAILED) 2>/dev/null`
586
600
  return nil if result =~ /GIT_FAILED/
@@ -593,7 +607,7 @@ class Tddium < Thor
593
607
 
594
608
  def handle_heroku_user(options, heroku_config)
595
609
  api_key = heroku_config['TDDIUM_API_KEY']
596
- user = tddium_client.call_api(:get, Api::Path::USERS, {}, api_key) rescue nil
610
+ user = call_api(:get, Api::Path::USERS, {}, api_key, false) rescue nil
597
611
  exit_failure Text::Error::HEROKU_MISCONFIGURED % "Unrecognized user" unless user
598
612
  say Text::Process::HEROKU_WELCOME % user["user"]["email"]
599
613
 
@@ -610,7 +624,7 @@ class Tddium < Thor
610
624
 
611
625
  begin
612
626
  user_id = user["user"]["id"]
613
- result = tddium_client.call_api(:put, "#{Api::Path::USERS}/#{user_id}/", {:user=>params, :heroku_activation=>true}, api_key)
627
+ result = call_api(:put, "#{Api::Path::USERS}/#{user_id}/", {:user=>params, :heroku_activation=>true}, api_key)
614
628
  rescue TddiumClient::Error::API => e
615
629
  exit_failure Text::Error::HEROKU_MISCONFIGURED % e
616
630
  rescue TddiumClient::Error::Base => e
@@ -808,7 +822,7 @@ puts "EXN: #{e.inspect}"
808
822
 
809
823
  def tddium_deploy_key_file_name
810
824
  extension = ".#{environment}" unless environment == :production
811
- ".tddium-deploy-key#{extension}"
825
+ return File.join(git_root, ".tddium-deploy-key#{extension}")
812
826
  end
813
827
 
814
828
  def suite_for_current_branch?
@@ -829,7 +843,7 @@ puts "EXN: #{e.inspect}"
829
843
 
830
844
  def tddium_file_name
831
845
  extension = ".#{environment}" unless environment == :production
832
- ".tddium#{extension}"
846
+ return File.join(git_root, ".tddium#{extension}")
833
847
  end
834
848
 
835
849
  def tddium_settings(options = {})
@@ -22,6 +22,7 @@ module TddiumConstant
22
22
  module Git
23
23
  REMOTE_NAME = "tddium"
24
24
  GITIGNORE = ".gitignore"
25
+ READY_TRIES = 3
25
26
  end
26
27
 
27
28
  module Api
@@ -39,6 +40,7 @@ module TddiumConstant
39
40
  end
40
41
  module ErrorCode
41
42
  INVALID_INVITATION = 2
43
+ GEM_OUT_OF_DATE = 10000
42
44
  end
43
45
  end
44
46
 
@@ -99,12 +101,15 @@ Next, you should:
99
101
  1. Register your test suite by running:
100
102
  tddium suite
101
103
 
102
- 2. Sign up for a billing plan by opening this URL in your browser:
103
- %s
104
-
105
- 3. Start tests by running:
104
+ 2. Start tests by running:
106
105
  tddium spec
107
106
 
107
+ You have %s days left in your free trial.
108
+
109
+ To sign up a for a billing plan, open this URL in your browser:
110
+
111
+ %s
112
+
108
113
  "
109
114
  ACCOUNT_ADDED = "
110
115
  Congratulations %s, your tddium account has been activated.
@@ -208,14 +213,12 @@ EOF
208
213
  SEPARATOR = "====="
209
214
  USING_SUITE = "Using suite...\n\n%s"
210
215
  USER_DETAILS =<<EOF;
216
+
211
217
  Username: <%=user["email"]%>
212
218
  Account Created: <%=user["created_at"]%>
213
- <% if user["recurly_url"] %>
214
- Recurly Management URL: <%=user["recurly_url"]%>
215
- <% end %>
216
- <% if user["heroku"] %>
217
- Heroku Account Linked: <%=user["heroku_activation_done"]%>
218
- <% end %>
219
+ <% if user["trial_remaining"] && user["trial_remaining"] > 0 %>Trial Period Remaining: <%=user["trial_remaining"]%> days<% end %>
220
+ <% if user["recurly_url"] %>Account Management URL: <%=user["recurly_url"]%><% end %>
221
+ <% if user["heroku"] %>Heroku Account Linked: <%=user["heroku_activation_done"]%><% end %>
219
222
  EOF
220
223
  HEROKU_CONFIG = "
221
224
  Tddium is configured to work with your Heroku app.
@@ -3,5 +3,5 @@ Copyright (c) 2011 Solano Labs All Rights Reserved
3
3
  =end
4
4
 
5
5
  module TddiumVersion
6
- VERSION = "0.9.2"
6
+ VERSION = "0.9.3"
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tddium-preview
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-23 00:00:00.000000000 Z
12
+ date: 2011-09-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &9705000 !ruby/object:Gem::Requirement
16
+ requirement: &18134260 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *9705000
24
+ version_requirements: *18134260
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: highline
27
- requirement: &9704580 !ruby/object:Gem::Requirement
27
+ requirement: &18133840 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *9704580
35
+ version_requirements: *18133840
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: json
38
- requirement: &9703980 !ruby/object:Gem::Requirement
38
+ requirement: &18133420 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *9703980
46
+ version_requirements: *18133420
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: tddium_client
49
- requirement: &9703300 !ruby/object:Gem::Requirement
49
+ requirement: &18132920 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.0.10
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *9703300
57
+ version_requirements: *18132920
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: tddium_reporting
60
- requirement: &9702080 !ruby/object:Gem::Requirement
60
+ requirement: &18132420 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.0.5
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *9702080
68
+ version_requirements: *18132420
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
- requirement: &9701100 !ruby/object:Gem::Requirement
71
+ requirement: &18130200 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *9701100
79
+ version_requirements: *18130200
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rspec
82
- requirement: &9700640 !ruby/object:Gem::Requirement
82
+ requirement: &18129700 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *9700640
90
+ version_requirements: *18129700
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: fakefs
93
- requirement: &9700080 !ruby/object:Gem::Requirement
93
+ requirement: &18129240 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *9700080
101
+ version_requirements: *18129240
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: simplecov
104
- requirement: &9699440 !ruby/object:Gem::Requirement
104
+ requirement: &18128820 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *9699440
112
+ version_requirements: *18128820
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: rake
115
- requirement: &9698800 !ruby/object:Gem::Requirement
115
+ requirement: &18128400 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,7 +120,7 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *9698800
123
+ version_requirements: *18128400
124
124
  description: ! 'tddium runs your rspec, cucumber, and test::unit tests in our managed
125
125
 
126
126
  cloud environment. You can run tests by hand, or enable our hosted CI to watch