gitenv 0.3.0 → 1.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
- SHA1:
3
- metadata.gz: c01b85f1089abd188b5127a3ee739ff9f0444d1c
4
- data.tar.gz: 475c4c025297edc07a150d611fb946d33094c256
2
+ SHA256:
3
+ metadata.gz: 87bcb09a6b7469ac950d386e5ee36a1e2fac55ab278bedc2f46c9efbd1c094d8
4
+ data.tar.gz: f34839c0178019d9964b289cc5d10c5756501758c2b8824fd6b6a0e875e21e39
5
5
  SHA512:
6
- metadata.gz: 8fd9b73508af24b593bb601358ef94a44daad5c4dd27c793ba4b700f420200f1897888a4a66d2a386a4b25142503d607fa82dbc168ee2b2c9eac73e8b6029403
7
- data.tar.gz: 3094a5ddab27645bfaf1713af0fe0d573a91e6a71e2815736a8c102e51abb8ffff766e94fc0d8063bf04f26defe0287ef992cf3de59b2b3949f9b1762256257d
6
+ metadata.gz: 4cd49bccc5029f75f8c41be61dd83aac0b965d009121131e68c51c11425a2deb151a549303773bc85238bc7e0566933d02ef0b5f3a24bc34011398d009a7ed52
7
+ data.tar.gz: 957f08d7a63d1085f4b320c4d138ed09816b20d22143279c4eacfd07a9279c8431d4e0ffd6342175ccaeed6066f5af190d06583722620551326e47f0214ca15c
data/Gemfile CHANGED
@@ -1,20 +1,20 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
  # Add dependencies required to use your gem here.
3
3
  # Example:
4
4
  # gem "activesupport", ">= 2.3.5"
5
5
 
6
- gem 'paint', '~> 1.0'
6
+ gem 'paint', '~> 2.1'
7
7
  gem 'commander', '~> 4.2'
8
8
 
9
9
  # Add dependencies to develop your gem here.
10
10
  # Include everything needed to run rake, tests, features, etc.
11
11
  group :development do
12
12
  require 'pp' # https://github.com/fakefs/fakefs/issues/99
13
- gem 'rake', '~> 11.0'
13
+ gem 'rake', '~> 12.3'
14
14
  gem 'rspec', '~> 3.1'
15
15
  gem 'rspec-its', '~> 1.1'
16
- gem 'fakefs', '~> 0.9.0', :require => 'fakefs/safe'
16
+ gem 'fakefs', '~> 0.20.1', :require => 'fakefs/safe'
17
17
  gem 'jeweler', '~> 2.0'
18
18
  gem 'rake-version', '~> 1.0'
19
- gem 'simplecov', '~> 0.12.0'
19
+ gem 'simplecov', '~> 0.16.1'
20
20
  end
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011 Alpha Hydrae
1
+ Copyright (c) 2011-2019 Simon Oulevay (Alpha Hydrae)
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 1.0.0
@@ -2,7 +2,7 @@
2
2
  require 'paint'
3
3
 
4
4
  module Gitenv
5
- VERSION = '0.3.0'
5
+ VERSION = '1.0.0'
6
6
  end
7
7
 
8
8
  Dir[File.join File.dirname(__FILE__), File.basename(__FILE__, '.*'), '*.rb'].each{ |lib| require lib }
@@ -35,8 +35,9 @@ module Gitenv
35
35
  def apply
36
36
  FileUtils.mkdir_p File.dirname(link) if @mkdir
37
37
  backup_exists = File.exist? link_backup
38
- FileUtils.mv link, link_backup if @backup && File.exist?(link) && !backup_exists
39
- FileUtils.rm link if @overwrite && File.exist?(link) && !backup_exists # TODO: only if link points somewhere else
38
+ FileUtils.mv link, link_backup if @backup && file_or_symlink_exists?(link) && !backup_exists
39
+ return if File.symlink?(link) && File.readlink(link) == target
40
+ FileUtils.rm link if @overwrite && file_or_symlink_exists?(link) && !backup_exists # TODO: only if link points somewhere else
40
41
  File.symlink target, link unless File.exist?(link)
41
42
  end
42
43
 
@@ -85,5 +86,11 @@ module Gitenv
85
86
  def link_name
86
87
  @link_name ||= @as || @file
87
88
  end
89
+
90
+ private
91
+
92
+ def file_or_symlink_exists? path
93
+ File.symlink?(path) || File.exist?(path)
94
+ end
88
95
  end
89
96
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitenv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Oulevay (Alpha Hydrae)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-26 00:00:00.000000000 Z
11
+ date: 2019-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paint
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '2.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '2.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: commander
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '11.0'
47
+ version: '12.3'
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
- version: '11.0'
54
+ version: '12.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.9.0
89
+ version: 0.20.1
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
- version: 0.9.0
96
+ version: 0.20.1
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: jeweler
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.12.0
131
+ version: 0.16.1
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 0.12.0
138
+ version: 0.16.1
139
139
  description: Gitenv sets up symlinks to your configuration files in a git repository.
140
140
  email: git@alphahydrae.com
141
141
  executables:
@@ -185,8 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  - !ruby/object:Gem::Version
186
186
  version: '0'
187
187
  requirements: []
188
- rubyforge_project:
189
- rubygems_version: 2.5.1
188
+ rubygems_version: 3.0.3
190
189
  signing_key:
191
190
  specification_version: 4
192
191
  summary: Symlink manager for git repositories with configuration files.