pa 1.3.1 → 1.3.2

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,20 @@
1
+ ## 1.3.2 (Sep 9, 2012)
2
+
3
+ Improvements
4
+
5
+ - `Pa.expand2` and `Pa.real2` support second arguments as `(name, dir=".")` ([@GutenYe][])
6
+
7
+ ## 1.3.0 (Aug 28, 2012)
8
+
9
+ Improvements
10
+
11
+ - add `Pa.relative_to?`, `Pa.relative_to2`, `Pa.has_ext?`, `Pa.delete_ext2`, `Pa.add_ext2` ([@GutenYe][])
12
+
13
+ Changes
14
+
15
+ - change `Pa.ext2` return from "ext" to ".ext", `Pa.fext2` return from ".ext" to "ext"
16
+ - remove `Pa.fname2`
17
+ - remove `Pa.build2` and change `Pa#build2` to `Pa#change2`
18
+
19
+ <!--- The following link definition list is generated by PimpMyChangelog --->
20
+ [@GutenYe]: https://github.com/GutenYe
data/Gemfile CHANGED
@@ -1,11 +1,12 @@
1
- source :rubygems
1
+ source "https://rubygems.org"
2
2
 
3
3
  gem "pd"
4
4
 
5
5
  group :development do
6
6
  gem "thor"
7
7
  gem "rspec"
8
- gem "watchr"
8
+ gem "guard"
9
+ gem "pimpmychangelog"
9
10
  end
10
11
 
11
12
  #gemspec
@@ -1,8 +1,22 @@
1
1
  GEM
2
- remote: http://rubygems.org/
2
+ remote: https://rubygems.org/
3
3
  specs:
4
4
  diff-lcs (1.1.3)
5
+ ffi (1.1.5)
6
+ guard (1.3.2)
7
+ listen (>= 0.4.2)
8
+ thor (>= 0.14.6)
9
+ listen (0.4.7)
10
+ rb-fchange (~> 0.0.5)
11
+ rb-fsevent (~> 0.9.1)
12
+ rb-inotify (~> 0.8.8)
5
13
  pd (1.1.0)
14
+ pimpmychangelog (0.0.3)
15
+ rb-fchange (0.0.5)
16
+ ffi
17
+ rb-fsevent (0.9.1)
18
+ rb-inotify (0.8.8)
19
+ ffi (>= 0.5.0)
6
20
  rspec (2.11.0)
7
21
  rspec-core (~> 2.11.0)
8
22
  rspec-expectations (~> 2.11.0)
@@ -12,14 +26,14 @@ GEM
12
26
  diff-lcs (~> 1.1.3)
13
27
  rspec-mocks (2.11.2)
14
28
  thor (0.15.4)
15
- watchr (0.7)
16
29
 
17
30
  PLATFORMS
18
31
  java
19
32
  ruby
20
33
 
21
34
  DEPENDENCIES
35
+ guard
22
36
  pd
37
+ pimpmychangelog
23
38
  rspec
24
39
  thor
25
- watchr
@@ -0,0 +1,5 @@
1
+ guard 'rspec', :version => 2 do
2
+ watch(%r{^spec/.+_spec\.rb$})
3
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
4
+ watch('spec/spec_helper.rb') { "spec" }
5
+ end
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  | License: | MIT-LICENSE |
8
8
  | Documentation: | http://rubydoc.info/gems/pa/frames |
9
9
  | Issue Tracker: | https://github.com/GutenYe/pa/issues |
10
- | Platforms: | Ruby 1.9.3, Rubinius |
10
+ | Ruby Versions: | Ruby 1.9.3, Rubinius |
11
11
 
12
12
  Usage
13
13
  -----
@@ -33,17 +33,24 @@ Install
33
33
 
34
34
  gem install pa
35
35
 
36
+ Development [![Dependency Status](https://gemnasium.com/GutenYe/pa.png?branch=master)](https://gemnasium.com/GutenYe/pa) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/GutenYe/pa)
37
+ ===========
38
+
36
39
  Contributing
37
40
  -------------
38
41
 
39
- * Feel free to join the project and make contributions (by submitting a pull request)
40
- * Submit any bugs/features/ideas to github issue tracker
42
+ * Submit any bugs/features/ideas to github issue tracker.
43
+
44
+ Pull requests are very welcome! Please try to follow these simple rules if applicable:
45
+
46
+ * Please create a topic branch for every separate change you make.
47
+ * Make sure your patches are well tested. All specs run with `rake test:portability` must pass.
41
48
  * Coding Style Guide: https://gist.github.com/1105334
42
49
 
43
50
  Contributors
44
51
  ------------
45
52
 
46
- * [contributors](https://github.com/GutenYe/pa/contributors)
53
+ [https://github.com/GutenYe/pa/contributors](https://github.com/GutenYe/pa/contributors)
47
54
 
48
55
  Copyright
49
56
  ---------
@@ -0,0 +1,30 @@
1
+ namespace :test do
2
+ desc "Run all specs on multiple ruby versions (requires rvm)"
3
+ task :portability do
4
+ require "yaml"
5
+
6
+ travis_config_file = File.expand_path("../.travis.yml", __FILE__)
7
+ begin
8
+ travis_options ||= YAML::load_file(travis_config_file)
9
+ rescue => ex
10
+ puts "Travis config file '#{travis_config_file}' could not be found: #{ex.message}"
11
+ return
12
+ end
13
+
14
+ travis_options['rvm'].each do |version|
15
+ system <<-BASH
16
+ bash -c 'source ~/.rvm/scripts/rvm;
17
+ rvm #{version};
18
+ ruby_version_string_size=`ruby -v | wc -m`
19
+ echo;
20
+ for ((c=1; c<$ruby_version_string_size; c++)); do echo -n "="; done
21
+ echo;
22
+ echo "`ruby -v`";
23
+ for ((c=1; c<$ruby_version_string_size; c++)); do echo -n "="; done
24
+ echo;
25
+ bundle install;
26
+ bundle exec rspec spec 2>&1;'
27
+ BASH
28
+ end
29
+ end
30
+ end
data/lib/pa.rb CHANGED
@@ -106,8 +106,8 @@ class Pa
106
106
  end
107
107
  end
108
108
 
109
- def absolute2(path)
110
- File.absolute_path(get(path), ".") # rbx
109
+ def absolute2(name, dir=".")
110
+ File.absolute_path(get(name), dir)
111
111
  end
112
112
 
113
113
  # => ".", "..", "/", "c:"
@@ -57,8 +57,16 @@ class Pa
57
57
  #
58
58
  # @param [String,Pa] path
59
59
  # @return [String]
60
- def expand2(path)
61
- File.expand_path get(path)
60
+ def expand2(name, dir=".")
61
+ File.expand_path(get(name), dir)
62
+ end
63
+
64
+ # Alias from Filel.realpath
65
+ #
66
+ # @param [String, Pa] path
67
+ # @return [String]
68
+ def real2(name, dir=".")
69
+ File.realpath(get(name), dir)
62
70
  end
63
71
 
64
72
  # Path relative_to? dir
@@ -172,11 +180,6 @@ class Pa
172
180
  end
173
181
  end
174
182
 
175
- # real path
176
- def real2(path)
177
- File.realpath get(path)
178
- end
179
-
180
183
  # get parent path
181
184
  #
182
185
  # @param [String,Pa] path
@@ -1,3 +1,3 @@
1
1
  class Pa
2
- VERSION = "1.3.1"
2
+ VERSION = "1.3.2"
3
3
  end
@@ -45,8 +45,14 @@ describe Pa do
45
45
  end
46
46
 
47
47
  describe ".expand2" do
48
- it "expand_path" do
49
- Pa.expand2("~").should == File.expand_path("~")
48
+ it do
49
+ Pa.expand2("~", ".").should == File.expand_path("~", ".")
50
+ end
51
+ end
52
+
53
+ describe ".real2" do
54
+ it do
55
+ Pa.real2(".", ".").should == File.realpath(".", ".")
50
56
  end
51
57
  end
52
58
 
@@ -94,7 +100,6 @@ describe Pa do
94
100
  end
95
101
  end
96
102
 
97
-
98
103
  describe ".shorten2" do
99
104
  it do
100
105
  Pa.stub(:home2) { "/home"}
@@ -106,10 +111,6 @@ describe Pa do
106
111
  end
107
112
  end
108
113
 
109
- describe ".real2" do
110
- Pa.real2(".").should == File.realpath(".")
111
- end
112
-
113
114
  describe ".parent2" do
114
115
  before :each do
115
116
  @path = "/home/foo/a.txt"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pa
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
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: 2012-08-29 00:00:00.000000000 Z
12
+ date: 2012-09-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pd
@@ -38,11 +38,13 @@ files:
38
38
  - .gitignore
39
39
  - .rspec
40
40
  - .travis.yml
41
- - CHANGELOG
41
+ - CHANGELOG.md
42
42
  - Gemfile
43
43
  - Gemfile.lock
44
+ - Guardfile
44
45
  - README.md
45
46
  - Ragfile
47
+ - Rakefile
46
48
  - lib/pa.rb
47
49
  - lib/pa/cmd.rb
48
50
  - lib/pa/directory.rb
@@ -52,7 +54,6 @@ files:
52
54
  - lib/pa/util.rb
53
55
  - lib/pa/version.rb
54
56
  - pa.gemspec
55
- - pa.watchr
56
57
  - spec/data/tmp/.gitkeep
57
58
  - spec/pa/cmd_spec.rb
58
59
  - spec/pa/directory_spec.rb
data/CHANGELOG DELETED
@@ -1,6 +0,0 @@
1
- *Pa 1.3.0 (Aug 28, 2012)*
2
- * change 'Pa.ext2' return from "ext" to ".ext", 'Pa.fext2' return from ".ext" to "ext"
3
- * remove 'Pa.fname2'
4
- * remove 'Pa.build2' and change 'Pa#build2' to 'Pa#change2'
5
-
6
- * add 'Pa.relative_to?', 'Pa.relative_to2', 'Pa.has_ext?', 'Pa.delete_ext2', 'Pa.add_ext2'
data/pa.watchr DELETED
@@ -1,22 +0,0 @@
1
- # lib/**/*.rb
2
- watch %r~lib/(.*)\.rb~ do |m|
3
- test "spec/#{m[1]}_spec.rb"
4
- end
5
-
6
- # spec/**/*_spec.rb
7
- watch %r~spec/.*_spec\.rb~ do |m|
8
- test m[0]
9
- end
10
-
11
- # Ctrl-\
12
- Signal.trap('QUIT') do
13
- puts "--- Running all tests ---\n\n"
14
- test "spec"
15
- end
16
-
17
- def test(path)
18
- system "clear"
19
- cmd = "bundle exec rspec #{path}"
20
- puts cmd
21
- system cmd
22
- end