gradesfirst 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,10 +12,10 @@ GEM
12
12
  debugger-ruby_core_source (~> 1.2.4)
13
13
  debugger-linecache (1.2.0)
14
14
  debugger-ruby_core_source (1.2.4)
15
+ http_magic (0.1.2)
15
16
  dotenv (0.11.1)
16
17
  dotenv-deployment (~> 0.0.2)
17
18
  dotenv-deployment (0.0.2)
18
- http_magic (0.1.1)
19
19
  method_source (0.8.2)
20
20
  minitest (4.7.5)
21
21
  pry (0.9.12.4)
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.platform = Gem::Platform::RUBY
3
3
  s.name = "gradesfirst"
4
- s.version = "0.6.2"
4
+ s.version = "0.6.3"
5
5
  s.summary = "GradesFirst command line utility for developers."
6
6
  s.description = "This utility will help manage the various tasks developers need to do on their workstation such as database updates."
7
7
  s.license = "MIT"
@@ -3,11 +3,22 @@ require 'dotenv'
3
3
  module GradesFirst
4
4
  class Config
5
5
  def initialize
6
- Dotenv.load(*GradesFirst::Config.load_paths)
6
+ if GradesFirst::Config.load_paths.any?{ |f| File.exist?(f) }
7
+ Dotenv.load(*GradesFirst::Config.load_paths)
8
+ else
9
+ puts <<-MESSAGE
10
+ The configuration file is missing and should be found in one of the
11
+ following locations:
12
+
13
+ #{GradesFirst::Config.load_paths.join('\n')}
14
+
15
+ See "gf help <command>" for details on configuration settings.
16
+ MESSAGE
17
+ end
7
18
  end
8
19
 
9
20
  def self.load_paths
10
- @@load_paths ||= [".env", "~/.env", ".env.master"]
21
+ @@load_paths ||= [".env.gf", "~/.env.gf", ".env.gf.master"]
11
22
  end
12
23
 
13
24
  def self.load_paths=(paths)
File without changes
@@ -0,0 +1,6 @@
1
+ The configuration file is missing and should be found in one of the
2
+ following locations:
3
+
4
+ test/fixtures/.env.gf.missing
5
+
6
+ See "gf help <command>" for details on configuration settings.
@@ -2,8 +2,23 @@ require 'test_helper'
2
2
  require 'gradesfirst/pair_command'
3
3
 
4
4
  describe GradesFirst::PairCommand do
5
- before do
6
- @command = GradesFirst::PairCommand.new
5
+ specify '#execute informs of missing config file' do
6
+ GradesFirst::Config.load_paths = ["test/fixtures/.env.gf.missing"]
7
+ command = GradesFirst::PairCommand.new
8
+
9
+ stdout, stderr = capture_io do
10
+ command.execute
11
+ end
12
+
13
+ assert_equal(
14
+ fixture_file('missing_config.txt'),
15
+ stdout,
16
+ 'The missing config file message was not displayed.'
17
+ )
18
+ end
19
+
20
+ specify '#execute pairs developers correctly' do
21
+ command = GradesFirst::PairCommand.new
7
22
  @developers = [
8
23
  'Mickey Mouse',
9
24
  'Cat Woman',
@@ -12,21 +27,18 @@ describe GradesFirst::PairCommand do
12
27
  'Minnie Mouse',
13
28
  'Ironman'
14
29
  ]
15
- end
16
-
17
- specify '#execute pairs developers correctly' do
18
30
  config = OpenStruct.new(
19
31
  developers: @developers,
20
32
  day_zero: Time.parse("2014-3-10 00:00:00")
21
33
  )
22
- @command.stub :config, config do
23
- @command.stub :now, Time.parse("2014-3-25 00:00:00") do
24
- @command.execute
34
+ command.stub :config, config do
35
+ command.stub :now, Time.parse("2014-3-25 00:00:00") do
36
+ command.execute
25
37
  end
26
38
  end
27
39
  assert_equal(
28
40
  fixture_file('pair.txt'),
29
- @command.response,
41
+ command.response,
30
42
  'Programmer pairing is not correct.'
31
43
  )
32
44
  end
@@ -14,7 +14,7 @@ class MiniTest::Unit::TestCase
14
14
 
15
15
  def setup
16
16
  pivotal_tracker_setup
17
- GradesFirst::Config.load_paths = ["test/fixtures/.env"]
17
+ GradesFirst::Config.load_paths = ["test/fixtures/.env.gf"]
18
18
  end
19
19
 
20
20
  # Retreive the contents of fixture files to be used in tests. It is easier
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gradesfirst
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-22 00:00:00.000000000 Z
12
+ date: 2014-08-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -114,11 +114,12 @@ files:
114
114
  - test/command_test.rb
115
115
  - test/commit_message_command_test.rb
116
116
  - test/config_test.rb
117
- - test/fixtures/.env
117
+ - test/fixtures/.env.gf
118
118
  - test/fixtures/code_talk.txt
119
119
  - test/fixtures/commit_message.txt
120
120
  - test/fixtures/gf_branch.txt
121
121
  - test/fixtures/git_branch.txt
122
+ - test/fixtures/missing_config.txt
122
123
  - test/fixtures/pair.txt
123
124
  - test/fixtures/projects.json
124
125
  - test/fixtures/story_bar.json