gitit 1.1.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9282688380f4990e69ca1300121a02b6f29d91a2
4
- data.tar.gz: ae24083296251f6a84d98a2de4e80456de975eae
3
+ metadata.gz: f7cf071b26037281690cd5e4e4789e5decbe072d
4
+ data.tar.gz: 226e78dddf07743516812d73904818b156fba32c
5
5
  SHA512:
6
- metadata.gz: a6aadd66dcb6e7b0fde3398a4b072773bc5aa32731fe1eda6c0bbff959ad299315ed986bd788c88c358f51a8152e0a0be04ed642dcda2529d517e79f552e939c
7
- data.tar.gz: 43efd3410eb13dfcbd13091f68b7d9cd8910e52482587feabe29f9550c07b5b278518db129d384126c312749bdc70f81562b7b170651f0fa5099baa8a56fe3cf
6
+ metadata.gz: d8401fe9bcb048e6f53c4ce393b170c63a466bbc04ea31a42819f0c35605726832e3140ab23598e05156fa1890f1fa8d50850ceab01cff3e762691621d753948
7
+ data.tar.gz: 6fb384a6d5468dae0bb716b4d002f9838a6fe03717836cc0bd6aa92bca8ca912a90062920eff9bcb99275385a7be9c655b64e9990e016515553b5dfca11b185c
data/Gemfile CHANGED
@@ -1,5 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
 
3
+ ruby '2.2.2'
4
+
3
5
  # Specify your gem's dependencies in scm-workflow.gemspec
4
6
  gemspec
5
7
 
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ begin
6
6
  Bundler.setup(:default, :development)
7
7
  rescue Bundler::BundlerError => e
8
8
  $stderr.puts e.message
9
- $stderr.puts "Run `bundle install` to install missing gems"
9
+ $stderr.puts 'Run `bundle install` to install missing gems'
10
10
  exit e.status_code
11
11
  end
12
12
  require 'rake'
@@ -29,7 +29,7 @@ require 'rspec/core'
29
29
  require 'rspec/core/rake_task'
30
30
  RSpec::Core::RakeTask.new(:spec) do |spec|
31
31
  spec.pattern = FileList['spec/**/*_spec.rb']
32
- spec.rspec_opts = Dir.glob("[0-9][0-9][0-9]_*").collect { |x| "-I#{x}" }
32
+ spec.rspec_opts = Dir.glob('[0-9][0-9][0-9]_*').collect { |x| "-I#{x}" }
33
33
  spec.rspec_opts << '--color -f d'
34
34
  end
35
35
 
@@ -40,7 +40,7 @@ end
40
40
 
41
41
  RSpec::Core::RakeTask.new(:coverage) do |spec|
42
42
  # add simplecov
43
- ENV["COVERAGE"] = 'yes'
43
+ ENV['COVERAGE'] = 'yes'
44
44
 
45
45
  # run the specs
46
46
  Rake::Task['spec'].execute
@@ -53,7 +53,7 @@ task :default => :spec
53
53
 
54
54
  require 'rdoc/task'
55
55
  Rake::RDocTask.new do |rdoc|
56
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
56
+ version = File.exist?('VERSION') ? File.read('VERSION') : ''
57
57
 
58
58
  rdoc.rdoc_dir = 'rdoc'
59
59
  rdoc.title = "gitit #{version}"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 2.0.0
@@ -1,7 +1,8 @@
1
1
  require 'gitit'
2
- require 'gitit/repo'
2
+ #require 'gitit/git_repo'
3
3
 
4
- Dir[File.dirname(__FILE__) + '/command_*.rb'].each do |file|
4
+ Dir[File.dirname(__FILE__) + '/git_*.rb'].each do |file|
5
+ # noinspection RubyResolve
5
6
  require file
6
7
  end
7
8
 
@@ -18,10 +19,10 @@ module Gitit
18
19
  # -------------------------------------------------------------------------
19
20
  # -------------------------------------------------------------------------
20
21
  def initialize(location)
21
- @repo = Repo.new(location)
22
- @config = Config.new(repo)
23
- @status = Status.new(repo)
24
- @branches = Branches.new(repo)
22
+ @repo = GitRepo.new(location)
23
+ @config = GitConfig.new(repo)
24
+ @status = GitStatus.new(repo)
25
+ @branches = GitBranches.new(repo)
25
26
  end
26
27
  end
27
28
 
@@ -1,13 +1,13 @@
1
- require 'gitit/command_executor'
1
+ require 'gitit/git_executor'
2
2
 
3
3
  module Gitit
4
4
 
5
5
  # ---------------------------------------------------------------------------
6
6
  # ---------------------------------------------------------------------------
7
- class Branch
8
- include CommandExecutor
7
+ class GitBranch
8
+ include GitExecutor
9
9
 
10
- attr_reader :name;
10
+ attr_reader :name
11
11
 
12
12
  # -------------------------------------------------------------------------
13
13
  # -------------------------------------------------------------------------
@@ -1,11 +1,11 @@
1
- require 'gitit/command_executor'
1
+ require 'gitit/git_executor'
2
2
 
3
3
  module Gitit
4
4
 
5
5
  # ---------------------------------------------------------------------------
6
6
  # ---------------------------------------------------------------------------
7
- class Branches
8
- include CommandExecutor
7
+ class GitBranches
8
+ include GitExecutor
9
9
 
10
10
  # -------------------------------------------------------------------------
11
11
  # -------------------------------------------------------------------------
@@ -1,45 +1,45 @@
1
- require 'gitit/command_executor'
1
+ require 'gitit/git_executor'
2
2
 
3
3
  module Gitit
4
4
 
5
5
  # ---------------------------------------------------------------------------
6
6
  # ---------------------------------------------------------------------------
7
- class Config
8
- include CommandExecutor
7
+ class GitConfig
8
+ include GitExecutor
9
9
 
10
- attr_accessor :location
11
-
12
- # -------------------------------------------------------------------------
13
10
  # -------------------------------------------------------------------------
14
- def initialize(repo, location='')
11
+ # @param [Object] repo
12
+ # @param [Object] location
13
+ # @return [Object]
14
+ def initialize(repo, location: '')
15
15
  @repo = repo
16
16
  @location = location
17
17
  end
18
-
19
- # -------------------------------------------------------------------------
18
+
20
19
  # -------------------------------------------------------------------------
20
+ # @param [Object] key
21
21
  def get_value(key)
22
22
  value = execute_command("config #{@location} --null --get #{key}")
23
23
  raise 'failure running command' if $?.exitstatus != 0
24
24
  value.slice!(0, value.length-1)
25
25
  end
26
-
27
- # -------------------------------------------------------------------------
26
+
28
27
  # -------------------------------------------------------------------------
28
+ # @param [Object] key
29
+ # @param [Object] value
29
30
  def set_value(key, value)
30
31
  val = value
31
32
  execute_command("config #{@location} \"#{key}\" \"#{val}\"")
32
33
  raise 'failure running command' if $?.exitstatus != 0
33
34
  end
34
-
35
- # -------------------------------------------------------------------------
35
+
36
36
  # -------------------------------------------------------------------------
37
+ # @param [Object] key
37
38
  def unset_value(key)
38
39
  execute_command("config #{@location} --null --unset #{key}")
39
40
  raise 'failure running command' if $?.exitstatus != 0
40
41
  end
41
-
42
- # -------------------------------------------------------------------------
42
+
43
43
  # -------------------------------------------------------------------------
44
44
  def remove_section(section)
45
45
  execute_command("config #{@location} --remove-section #{section}")
@@ -0,0 +1,20 @@
1
+
2
+ module Gitit
3
+
4
+ module GitExecutor
5
+
6
+ attr_reader :repo
7
+
8
+ def self.repo
9
+ @repo
10
+ end
11
+
12
+ def execute_command(command)
13
+ git_command = ['git', command].join(' ')
14
+ `(cd #{@repo.location} && #{git_command} 2>&1)`
15
+ end
16
+
17
+ end
18
+
19
+ end
20
+
@@ -4,7 +4,7 @@ module Gitit
4
4
 
5
5
  # ---------------------------------------------------------------------------
6
6
  # ---------------------------------------------------------------------------
7
- class Repo
7
+ class GitRepo
8
8
  attr_reader :location;
9
9
 
10
10
  # -------------------------------------------------------------------------
@@ -1,11 +1,11 @@
1
- require 'gitit/command_executor'
1
+ require 'gitit/git_executor'
2
2
 
3
3
  module Gitit
4
4
 
5
5
  # ---------------------------------------------------------------------------
6
6
  # ---------------------------------------------------------------------------
7
- class Status
8
- include CommandExecutor
7
+ class GitStatus
8
+ include GitExecutor
9
9
 
10
10
  # -------------------------------------------------------------------------
11
11
  # -------------------------------------------------------------------------
@@ -1,3 +1,3 @@
1
1
  module Gitit
2
- VERSION = '0.1.1'
2
+ VERSION = '1.0.0'
3
3
  end
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  module Gitit
4
4
 
5
- describe Branch do
5
+ describe 'GitBranchSpec' do
6
6
 
7
7
  # -------------------------------------------------------------------------
8
8
  # -------------------------------------------------------------------------
@@ -13,7 +13,7 @@ module Gitit
13
13
  git = Git.new(TEST_REPO_PATH)
14
14
  @my_repo = git.repo
15
15
  @my_repo.init
16
- @repoBranch = Gitit::Branch.new(@my_repo, 'master')
16
+ @repo_branch = Gitit::GitBranch.new(@my_repo, 'master')
17
17
  end
18
18
 
19
19
  it 'will tell us if the branch is a valid branch' do
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  module Gitit
4
4
 
5
- describe Branches do
5
+ describe GitBranches do
6
6
 
7
7
  # -------------------------------------------------------------------------
8
8
  # -------------------------------------------------------------------------
@@ -13,12 +13,12 @@ module Gitit
13
13
  git = Git.new(TEST_REPO_PATH)
14
14
  @my_repo = git.repo
15
15
  @my_repo.init
16
- @repoBranches = git.branches
16
+ @repo_branches = git.branches
17
17
 
18
18
  `(cd #{TEST_REPO_PATH} && git config user.email "you@example.com")`
19
19
  `(cd #{TEST_REPO_PATH} && git config user.name "example")`
20
20
 
21
- File.open("#{TEST_REPO_PATH}/out.txt", "w+") { |file| file.write("boo!") }
21
+ File.open("#{TEST_REPO_PATH}/out.txt", 'w+') { |file| file.write('boo!') }
22
22
  `(cd #{TEST_REPO_PATH} && git add #{TEST_REPO_PATH}/out.txt && git commit -am "wip")`
23
23
 
24
24
  `(mkdir -p #{TEST_REPO_PATH_BARE} && cd #{TEST_REPO_PATH_BARE} && git init --bare)`
@@ -28,24 +28,24 @@ module Gitit
28
28
  end
29
29
 
30
30
  it 'will successfully find a valid local branch' do
31
- @repoBranches.exists_locally?('master').should eq true
31
+ expect(@repo_branches.exists_locally?('master')).to be_truthy
32
32
  end
33
33
 
34
34
  it 'will fail to find an invalid local branch' do
35
- @repoBranches.exists_locally?('some_random_name').should eq false
35
+ expect(@repo_branches.exists_locally?('some_random_name')).to be_falsey
36
36
  end
37
37
 
38
38
  it 'will successfully find a valid remote branch' do
39
- @repoBranches.exists_remotely?('master', 'origin').should eq true
39
+ expect(@repo_branches.exists_remotely?('master', 'origin')).to be_truthy
40
40
  end
41
41
 
42
42
  it 'will fail to find an invalid remote branch' do
43
- @repoBranches.exists_remotely?('some_random_name', 'origin').should eq false
43
+ expect(@repo_branches.exists_remotely?('some_random_name', 'origin')).to be_falsey
44
44
  end
45
45
 
46
46
  it 'will successfully return the right branch name' do
47
47
  `(cd #{TEST_REPO_PATH} && git checkout master --quiet)`
48
- @repoBranches.get_current_branch.should eq 'master'
48
+ expect(@repo_branches.get_current_branch).to eq('master')
49
49
  end
50
50
 
51
51
  after(:each) do
@@ -64,9 +64,9 @@ module Gitit
64
64
  git = Git.new(TEST_REPO_PATH)
65
65
  @my_repo = git.repo
66
66
  @my_repo.init
67
- @repoBranches = git.branches
67
+ @repo_branches = git.branches
68
68
 
69
- File.open("#{TEST_REPO_PATH}/out.txt", "w+") { |file| file.write("boo!") }
69
+ File.open("#{TEST_REPO_PATH}/out.txt", 'w+') { |file| file.write('boo!') }
70
70
  `(cd #{TEST_REPO_PATH} && git add #{TEST_REPO_PATH}/out.txt && git commit -am "wip")`
71
71
 
72
72
  `(mkdir -p #{TEST_REPO_PATH_BARE} && cd #{TEST_REPO_PATH_BARE} && git init --bare)`
@@ -76,35 +76,35 @@ module Gitit
76
76
  end
77
77
 
78
78
  it 'will fail to create a local branch' do
79
- @repoBranches.create_local_branch('mybranch').should eq true
80
- @repoBranches.create_local_branch('mybranch').should eq false
79
+ expect(@repo_branches.create_local_branch('mybranch')).to be_truthy
80
+ expect(@repo_branches.create_local_branch('mybranch')).to be_falsey
81
81
  end
82
82
 
83
83
  it 'will create a local branch successfully' do
84
- @repoBranches.create_local_branch('mybranch').should eq true
85
- @repoBranches.exists_locally?('mybranch').should eq true
86
- @repoBranches.exists_remotely?('mybranch', 'origin').should eq false
84
+ expect(@repo_branches.create_local_branch('mybranch')).to be_truthy
85
+ expect(@repo_branches.exists_locally?('mybranch')).to be_truthy
86
+ expect(@repo_branches.exists_remotely?('mybranch', 'origin')).to be_falsey
87
87
  end
88
88
 
89
89
  it 'will fail to push a local branch to an invalid remote' do
90
- @repoBranches.create_local_branch('mybranch').should eq true
91
- @repoBranches.exists_remotely?('mybranch', 'origin').should eq false
92
- @repoBranches.push_local_branch_to_remote('mybranch', 'badorigin', false).should eq false
93
- @repoBranches.exists_remotely?('mybranch', 'origin').should eq false
90
+ expect(@repo_branches.create_local_branch('mybranch')).to be_truthy
91
+ expect(@repo_branches.exists_remotely?('mybranch', 'origin')).to be_falsey
92
+ expect(@repo_branches.push_local_branch_to_remote('mybranch', 'badorigin', false)).to be_falsey
93
+ expect(@repo_branches.exists_remotely?('mybranch', 'origin')).to be_falsey
94
94
  end
95
95
 
96
96
  it 'will push a local branch to the remote not forcing it' do
97
- @repoBranches.create_local_branch('mybranch').should eq true
98
- @repoBranches.exists_remotely?('mybranch', 'origin').should eq false
99
- @repoBranches.push_local_branch_to_remote('mybranch', 'origin', false).should eq true
100
- @repoBranches.exists_remotely?('mybranch', 'origin').should eq true
97
+ expect(@repo_branches.create_local_branch('mybranch')).to be_truthy
98
+ expect(@repo_branches.exists_remotely?('mybranch', 'origin')).to be_falsey
99
+ expect(@repo_branches.push_local_branch_to_remote('mybranch', 'origin', false)).to be_truthy
100
+ expect(@repo_branches.exists_remotely?('mybranch', 'origin')).to be_truthy
101
101
  end
102
102
 
103
103
  it 'will push a local branch to the remote forcing it' do
104
- @repoBranches.create_local_branch('mybranch').should eq true
105
- @repoBranches.exists_remotely?('mybranch', 'origin').should eq false
106
- @repoBranches.push_local_branch_to_remote('mybranch', 'origin', true).should eq true
107
- @repoBranches.exists_remotely?('mybranch', 'origin').should eq true
104
+ expect(@repo_branches.create_local_branch('mybranch')).to be_truthy
105
+ expect(@repo_branches.exists_remotely?('mybranch', 'origin')).to be_falsey
106
+ expect(@repo_branches.push_local_branch_to_remote('mybranch', 'origin', true)).to be_truthy
107
+ expect(@repo_branches.exists_remotely?('mybranch', 'origin')).to be_truthy
108
108
  end
109
109
 
110
110
  after(:each) do
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  module Gitit
4
4
 
5
- describe Config do
5
+ describe GitConfig do
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
  # -----------------------------------------------------------------------------
@@ -20,7 +20,7 @@ module Gitit
20
20
  FileUtils.mkpath TEST_REPO_PATH
21
21
  @git = Git.new(TEST_REPO_PATH)
22
22
  @git.repo.init
23
- @config = Config.new(@git.repo, mode)
23
+ @config = GitConfig.new(@git.repo, location: mode)
24
24
 
25
25
  @key_name = 'bla'
26
26
  @key = key_section + '.' + @key_name
@@ -29,7 +29,7 @@ module Gitit
29
29
  end
30
30
 
31
31
  it 'will set the specified key to the specified value successfully' do
32
- lambda{@config.set_value(@key, @key_value)}.should_not raise_error
32
+ expect{@config.set_value(@key, @key_value)}.to_not raise_error
33
33
 
34
34
  `(git config #{mode} --unset #{@key})`
35
35
  `(cd #{TEST_REPO_PATH} && git config #{mode} --remove-section #{key_section})`
@@ -37,27 +37,27 @@ module Gitit
37
37
 
38
38
  it 'will retrieve the specified value successfully' do
39
39
  value = ''
40
- lambda{@config.set_value(@key, @key_value)}.should_not raise_error
41
- lambda{value = @config.get_value(@key)}.should_not raise_error
42
- value.should eq @key_value
40
+ expect{@config.set_value(@key, @key_value)}.to_not raise_error
41
+ expect{value = @config.get_value(@key)}.to_not raise_error
42
+ expect(value).to eq(@key_value)
43
43
 
44
44
  `(git config #{mode} --unset #{@key})`
45
45
  `(cd #{TEST_REPO_PATH} && git config #{mode} --remove-section #{key_section})`
46
46
  end
47
47
 
48
48
  it 'will unset the specified key successfully' do
49
- lambda{@config.set_value(@key, @key_value)}.should_not raise_error
50
- lambda{@config.unset_value(@key)}.should_not raise_error
51
- lambda{@config.get_value(@key)}.should raise_error
49
+ expect{@config.set_value(@key, @key_value)}.to_not raise_error
50
+ expect{@config.unset_value(@key)}.to_not raise_error
51
+ expect{@config.get_value(@key)}.to raise_error
52
52
 
53
53
  `(cd #{TEST_REPO_PATH} && git config #{mode} --remove-section #{key_section})`
54
54
  end
55
55
 
56
56
  it 'will remove the specified section successfully' do
57
- lambda{@config.set_value(@key, @key_value)}.should_not raise_error
58
- lambda{@config.unset_value(@key)}.should_not raise_error
59
- lambda{@config.remove_section(key_section)}.should_not raise_error
60
- lambda{@config.get_value(@key)}.should raise_error
57
+ expect{@config.set_value(@key, @key_value)}.to_not raise_error
58
+ expect{@config.unset_value(@key)}.to_not raise_error
59
+ expect{@config.remove_section(key_section)}.to_not raise_error
60
+ expect{@config.get_value(@key)}.to raise_error
61
61
  end
62
62
 
63
63
  after(:each) do
@@ -2,36 +2,31 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  module Gitit
4
4
 
5
- describe Repo do
5
+ describe GitRepo do
6
6
 
7
7
  # -------------------------------------------------------------------------
8
8
  # -------------------------------------------------------------------------
9
9
  describe '#initialize' do
10
10
 
11
- TMP_PATH = '/tmp/'
12
- BAD_PATH = '/adsdsadasdsa'
13
- TEST_REPO_PATH = '/tmp/test_git'
14
- TEST_REPO_PATH_BARE = '/tmp/test_git_bare'
15
-
16
11
  before(:each) do
17
12
  end
18
13
 
19
14
  it 'will open fine given a valid repo' do
20
- lambda{Git.new(Dir.pwd)}.should_not raise_error
15
+ expect { Git.new(Dir.pwd) }.to_not raise_exception
21
16
  end
22
17
 
23
18
  it 'will throw an error given an invalid repo' do
24
- lambda{Git.new(BAD_PATH)}.should raise_error
19
+ expect { Git.new(BAD_PATH) }.to raise_exception
25
20
  end
26
21
 
27
22
  it 'will return true on valid repo' do
28
- myRepo = Git.new(Dir.pwd).repo
29
- myRepo.valid?.should eq true
23
+ my_repo = Git.new(Dir.pwd).repo
24
+ expect(my_repo.valid?).to be_truthy
30
25
  end
31
26
 
32
27
  it 'will return false on invalid repo' do
33
- myRepo = Git.new(TMP_PATH).repo
34
- myRepo.valid?.should eq false
28
+ my_repo = Git.new(TMP_PATH).repo
29
+ expect(my_repo.valid?).to be_falsey
35
30
  end
36
31
 
37
32
  end
@@ -47,15 +42,15 @@ module Gitit
47
42
  end
48
43
 
49
44
  it 'will initialize a new repo on an existing folder' do
50
- @my_repo.valid?.should eq false
51
- lambda{@my_repo.init}.should_not raise_error
45
+ expect(@my_repo.valid?).to be_falsey
46
+ expect { @my_repo.init }.to_not raise_exception
52
47
  end
53
48
 
54
49
  it 'will fail to initialize a new repo on an existing folder already initialized' do
55
- @my_repo.valid?.should eq false
56
- lambda{@my_repo.init}.should_not raise_error
57
- @my_repo.valid?.should eq true
58
- lambda{@my_repo.init}.should raise_error
50
+ expect(@my_repo.valid?).to be_falsey
51
+ expect { @my_repo.init }.to_not raise_exception
52
+ expect(@my_repo.valid?).to be_truthy
53
+ expect { @my_repo.init }.to raise_exception
59
54
  end
60
55
 
61
56
  after(:each) do
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
3
3
 
4
4
  module Gitit
5
5
 
6
- describe Status do
6
+ describe GitStatus do
7
7
 
8
8
  # -------------------------------------------------------------------------
9
9
  # -------------------------------------------------------------------------
@@ -22,15 +22,15 @@ module Gitit
22
22
  end
23
23
 
24
24
  it 'will tell us that the current branch is clean when nothing has been changed' do
25
- @repo_status.clean?.should eq true
25
+ expect(@repo_status.clean?).to be_truthy
26
26
  end
27
27
 
28
28
  it 'will tell us that the current branch is not clean when there are untracked file' do
29
29
  File.open("#{TEST_REPO_PATH}/out.txt", 'w+') { |file| file.write('boo!') }
30
- @repo_status.untracked_files?.should eq true
31
- @repo_status.unstaged_files?.should eq false
32
- @repo_status.uncommited_files?.should eq false
33
- @repo_status.clean?.should eq false
30
+ expect(@repo_status.untracked_files?).to be_truthy
31
+ expect(@repo_status.unstaged_files?).to be_falsey
32
+ expect(@repo_status.uncommited_files?).to be_falsey
33
+ expect(@repo_status.clean?).to be_falsey
34
34
  end
35
35
 
36
36
  it 'will tell us that the current branch is not clean when there are unstaged file' do
@@ -38,10 +38,10 @@ module Gitit
38
38
  `(cd #{TEST_REPO_PATH} && git add #{TEST_REPO_PATH}/out.txt)`
39
39
  `(cd #{TEST_REPO_PATH} && git commit -am "wip")`
40
40
  File.open("#{TEST_REPO_PATH}/out.txt", 'w') { |file| file.write('bdssdsoo!') }
41
- @repo_status.untracked_files?.should eq false
42
- @repo_status.unstaged_files?.should eq true
43
- @repo_status.uncommited_files?.should eq false
44
- @repo_status.clean?.should eq false
41
+ expect(@repo_status.untracked_files?).to be_falsey
42
+ expect(@repo_status.unstaged_files?).to be_truthy
43
+ expect(@repo_status.uncommited_files?).to be_falsey
44
+ expect(@repo_status.clean?).to be_falsey
45
45
  end
46
46
 
47
47
  it 'will tell us that the current branch is not clean when there are uncommited file' do
@@ -50,23 +50,23 @@ module Gitit
50
50
  `(cd #{TEST_REPO_PATH} && git commit -am "wip")`
51
51
  File.open("#{TEST_REPO_PATH}/out.txt", 'w') { |file| file.write('bdssdsoo!') }
52
52
  `(cd #{TEST_REPO_PATH} && git add #{TEST_REPO_PATH}/out.txt)`
53
- @repo_status.untracked_files?.should eq false
54
- @repo_status.unstaged_files?.should eq false
55
- @repo_status.uncommited_files?.should eq true
56
- @repo_status.clean?.should eq false
53
+ expect(@repo_status.untracked_files?).to be_falsey
54
+ expect(@repo_status.unstaged_files?).to be_falsey
55
+ expect(@repo_status.uncommited_files?).to be_truthy
56
+ expect(@repo_status.clean?).to be_falsey
57
57
  end
58
58
 
59
59
  it 'will tell us that there are untracked files after adding a new file' do
60
60
  File.open("#{TEST_REPO_PATH}/out.txt", 'w+') { |file| file.write('boo!') }
61
- @repo_status.untracked_files?.should eq true
61
+ expect(@repo_status.untracked_files?).to be_truthy
62
62
  end
63
63
 
64
64
  it 'will tell us that there are unstage files after modifying a file' do
65
- File.open("#{TEST_REPO_PATH}/out.txt", "w+") { |file| file.write('boo!') }
65
+ File.open("#{TEST_REPO_PATH}/out.txt", 'w+') { |file| file.write('boo!') }
66
66
  `(cd #{TEST_REPO_PATH} && git add #{TEST_REPO_PATH}/out.txt)`
67
67
  `(cd #{TEST_REPO_PATH} && git commit -am "wip")`
68
68
  File.open("#{TEST_REPO_PATH}/out.txt", 'w') { |file| file.write('bdssdsoo!') }
69
- @repo_status.unstaged_files?.should eq true
69
+ expect(@repo_status.unstaged_files?).to be_truthy
70
70
  end
71
71
 
72
72
  it 'will tell us if there are uncommit files after adding a modified file to staging' do
@@ -75,7 +75,7 @@ module Gitit
75
75
  `(cd #{TEST_REPO_PATH} && git commit -am "wip")`
76
76
  File.open("#{TEST_REPO_PATH}/out.txt", 'w') { |file| file.write('bdssdsoo!') }
77
77
  `(cd #{TEST_REPO_PATH} && git add #{TEST_REPO_PATH}/out.txt)`
78
- @repo_status.uncommited_files?.should eq true
78
+ expect(@repo_status.uncommited_files?).to be_truthy
79
79
  end
80
80
 
81
81
  after(:each) do
@@ -1,3 +1,9 @@
1
+
2
+ TMP_PATH = '/tmp/'
3
+ BAD_PATH = '/adsdsadasdsa'
4
+ TEST_REPO_PATH = '/tmp/test_git'
5
+ TEST_REPO_PATH_BARE = '/tmp/test_git_bare'
6
+
1
7
  if ENV['COVERAGE'] == 'yes'
2
8
  require 'simplecov'
3
9
  SimpleCov.start
metadata CHANGED
@@ -1,125 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Laplante
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-06 00:00:00.000000000 Z
11
+ date: 2015-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: cli-colorize
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rdoc
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.12'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.12'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: cucumber
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: 1.0.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: 1.0.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: simplecov
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: ruby
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: builder
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  description: '"ruby git command line wrapper"'
@@ -129,11 +129,10 @@ executables: []
129
129
  extensions: []
130
130
  extra_rdoc_files: []
131
131
  files:
132
- - .document
133
- - .gitignore
134
- - .idea/dictionaries/pat.xml
135
- - .rspec
136
- - .travis.yml
132
+ - ".document"
133
+ - ".gitignore"
134
+ - ".rspec"
135
+ - ".travis.yml"
137
136
  - Gemfile
138
137
  - LICENSE.txt
139
138
  - README.md
@@ -146,14 +145,13 @@ files:
146
145
  - gitit.gemspec
147
146
  - gitit.gemspecbak
148
147
  - lib/gitit.rb
149
- - lib/gitit/command_branch.rb
150
- - lib/gitit/command_branches.rb
151
- - lib/gitit/command_config.rb
152
- - lib/gitit/command_executor.rb
153
- - lib/gitit/command_status.rb
154
- - lib/gitit/foo.rb
155
148
  - lib/gitit/git.rb
156
- - lib/gitit/repo.rb
149
+ - lib/gitit/git_branch.rb
150
+ - lib/gitit/git_branches.rb
151
+ - lib/gitit/git_config.rb
152
+ - lib/gitit/git_executor.rb
153
+ - lib/gitit/git_repo.rb
154
+ - lib/gitit/git_status.rb
157
155
  - lib/gitit/version.rb
158
156
  - lib/tasks/version.rake
159
157
  - spec/gitit_branch_spec.rb
@@ -172,17 +170,17 @@ require_paths:
172
170
  - lib
173
171
  required_ruby_version: !ruby/object:Gem::Requirement
174
172
  requirements:
175
- - - '>='
173
+ - - ">="
176
174
  - !ruby/object:Gem::Version
177
175
  version: '0'
178
176
  required_rubygems_version: !ruby/object:Gem::Requirement
179
177
  requirements:
180
- - - '>='
178
+ - - ">="
181
179
  - !ruby/object:Gem::Version
182
180
  version: '0'
183
181
  requirements: []
184
182
  rubyforge_project:
185
- rubygems_version: 2.1.11
183
+ rubygems_version: 2.4.8
186
184
  signing_key:
187
185
  specification_version: 4
188
186
  summary: ''
@@ -1,19 +0,0 @@
1
- <component name="ProjectDictionaryState">
2
- <dictionary name="pat">
3
- <words>
4
- <w>adsdsadasdsa</w>
5
- <w>badorigin</w>
6
- <w>bdssdsoo</w>
7
- <w>dsaadk</w>
8
- <w>gitit</w>
9
- <w>mybranch</w>
10
- <w>mytestkey</w>
11
- <w>uncommit</w>
12
- <w>uncommited</w>
13
- <w>unstage</w>
14
- <w>unstaged</w>
15
- <w>untracked</w>
16
- <w>withsub</w>
17
- </words>
18
- </dictionary>
19
- </component>
@@ -1,16 +0,0 @@
1
-
2
- module Gitit
3
-
4
- module CommandExecutor
5
-
6
- attr_reader :repo
7
-
8
- def execute_command(command)
9
- gitCommand = ['git', command].join(' ')
10
- `(cd #{@repo.location} && #{gitCommand} 2>&1)`
11
- end
12
-
13
- end
14
-
15
- end
16
-
@@ -1,8 +0,0 @@
1
-
2
- puts __FILE__
3
- puts File.dirname(__FILE__)
4
- Dir[File.dirname(__FILE__) + "/command_*.rb"].each do |file|
5
- puts file
6
-
7
- end
8
-