ptools 1.2.4 → 1.2.6

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: 8b1ad5b7756616fecd9369472860f83dd3294f5e
4
- data.tar.gz: 44943151f729df7c9c2f5a00fbfd9491ac3ea694
3
+ metadata.gz: ff44afa8e0b25cca28c3cfac9ce34788eb8b69ba
4
+ data.tar.gz: 2722e012c24b7283b6780a0e9e3b8edd9e038f67
5
5
  SHA512:
6
- metadata.gz: 3f05fdc52605e22f394c85b575aa9dccb475b707665da115615ba2fafd807b9649a860446ca2088f27ee7973f83b3f3bb1a129b464e1a094c5845ef990949e74
7
- data.tar.gz: 6447938245ae44d917b9013a3d0a128e80b26218db680f4b81a01e5d9734b91b591ab8f673afab7d36eb4fe23638cde85fe7c98e6c564a90aa34e51529e730b3
6
+ metadata.gz: 62fcdbcbba8ce694f3207bf1bedb6f6d8e865ca20b7fa5b33209ac154373f69950b3e05f6dafee805a6535d320afe946860c8985079b6b2bc802b70a24eec4c6
7
+ data.tar.gz: 1e538e79107494c441f8099612330ecd3fef6d403e09ea6a780554c38c64555756fc1923cfddf8044ee7a3ffcd7ba9f1ed9b0b91e28f937d5fad1318f03c462c
data/CHANGES CHANGED
@@ -1,3 +1,16 @@
1
+ == 1.2.6 - 14-Jul-2014
2
+ * Updated the png? and jpg? methods so they explicitly specify the
3
+ offset argument so that it works with 1.9.2 and earlier. Thanks go to
4
+ Anurag Priyam for the spot.
5
+
6
+ == 1.2.5 - 11-Jul-2014
7
+ * Added a Gemfile, mostly for Travis CI.
8
+ * Added rake as a development dependency.
9
+ * Revert back to hash syntax supported by 1.8.x.
10
+ * Removed rubyforge_project from gemspec.
11
+ * Updated the tests for File.sparse? so that it doesn't rely on
12
+ an external file.
13
+
1
14
  == 1.2.4 - 25-Feb-2014
2
15
  * The File.binary method now always returns false for images. It is meant to
3
16
  detect executables, shared objects, etc. Use File.image? to detect images.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'structured_warnings'
4
+
5
+ group :production do
6
+ gem 'win32-file' if File::ALT_SEPARATOR
7
+ end
8
+
9
+ group :test do
10
+ gem 'rake'
11
+ gem 'test-unit'
12
+ end
data/README CHANGED
@@ -28,9 +28,8 @@
28
28
  File.nl_convert("myfile", "newfile", "dos")
29
29
 
30
30
  == Known Bugs
31
- None known. Please report any bugs on the github or RubyForge project page.
31
+ None known. Please report any bugs on the github project page.
32
32
 
33
- http://www.rubyforge.org/projects/shards
34
33
  http://www.github.com/djberg96/ptools
35
34
 
36
35
  == Acknowledgements
@@ -53,7 +52,7 @@
53
52
  Artistic 2.0
54
53
 
55
54
  == Copyright
56
- (C) 2003-2012 Daniel J. Berger
55
+ (C) 2003-2014 Daniel J. Berger
57
56
  All Rights Reserved.
58
57
 
59
58
  == Warranty
data/Rakefile CHANGED
@@ -29,7 +29,7 @@ namespace 'gem' do
29
29
  desc 'Install the ptools gem'
30
30
  task :install => [:create] do
31
31
  file = Dir["*.gem"].first
32
- sh "gem install #{file}"
32
+ sh "gem install -l #{file}"
33
33
  end
34
34
  end
35
35
 
data/lib/ptools.rb CHANGED
@@ -3,7 +3,7 @@ require 'win32/file' if File::ALT_SEPARATOR
3
3
 
4
4
  class File
5
5
  # The version of the ptools library.
6
- PTOOLS_VERSION = '1.2.4'
6
+ PTOOLS_VERSION = '1.2.6'
7
7
 
8
8
  # :stopdoc:
9
9
 
@@ -292,7 +292,7 @@ class File
292
292
  raise ArgumentError, "Invalid platform string"
293
293
  end
294
294
 
295
- orig = $\ # AKA $OUTPUT_RECORD_SEPARATOR
295
+ orig = $\ # $OUTPUT_RECORD_SEPARATOR
296
296
  $\ = format
297
297
 
298
298
  if old_file == new_file
@@ -418,11 +418,11 @@ class File
418
418
  end
419
419
 
420
420
  def self.jpg?(file)
421
- IO.read(file, 10, encoding: 'binary') == "\377\330\377\340\000\020JFIF".force_encoding(Encoding::BINARY)
421
+ IO.read(file, 10, nil, :encoding => 'binary') == "\377\330\377\340\000\020JFIF".force_encoding(Encoding::BINARY)
422
422
  end
423
423
 
424
424
  def self.png?(file)
425
- IO.read(file, 4, encoding: 'binary') == "\211PNG".force_encoding(Encoding::BINARY)
425
+ IO.read(file, 4, nil, :encoding => 'binary') == "\211PNG".force_encoding(Encoding::BINARY)
426
426
  end
427
427
 
428
428
  def self.gif?(file)
data/ptools.gemspec CHANGED
@@ -3,7 +3,7 @@ require 'rbconfig'
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.name = 'ptools'
6
- gem.version = '1.2.4'
6
+ gem.version = '1.2.6'
7
7
  gem.license = 'Artistic 2.0'
8
8
  gem.author = 'Daniel J. Berger'
9
9
  gem.email = 'djberg96@gmail.com'
@@ -12,7 +12,6 @@ Gem::Specification.new do |gem|
12
12
  gem.test_files = Dir['test/test*']
13
13
  gem.files = Dir['**/*'] << '.gemtest'
14
14
 
15
- gem.rubyforge_project = 'shards'
16
15
  gem.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
17
16
 
18
17
  gem.description = <<-EOF
@@ -21,6 +20,7 @@ Gem::Specification.new do |gem|
21
20
  File.null to return the null device on your platform, and so on.
22
21
  EOF
23
22
 
23
+ gem.add_development_dependency('rake')
24
24
  gem.add_development_dependency('test-unit', '>= 2.5.0')
25
25
 
26
26
  if File::ALT_SEPARATOR
@@ -15,7 +15,7 @@ class TC_Ptools_Constants < Test::Unit::TestCase
15
15
  end
16
16
 
17
17
  test "PTOOLS_VERSION constant is set to expected value" do
18
- assert_equal('1.2.4', File::PTOOLS_VERSION)
18
+ assert_equal('1.2.6', File::PTOOLS_VERSION)
19
19
  end
20
20
 
21
21
  test "IMAGE_EXT constant is set to array of values" do
@@ -10,13 +10,13 @@ require 'ptools'
10
10
  class TC_IsSparse < Test::Unit::TestCase
11
11
  def self.startup
12
12
  Dir.chdir("test") if File.exist?("test")
13
- @@win = RbConfig::CONFIG['host_os'] =~ /windows|mswin|dos|cygwin|mingw/i
13
+ @@win = File::ALT_SEPARATOR
14
14
  @@osx = RbConfig::CONFIG['host_os'] =~ /darwin|osx/i
15
- @@sun = RbConfig::CONFIG['host_os'] =~ /sunos|solaris/i
15
+ system("dd of=test_sparse bs=1k seek=5120 count=0 2>/dev/null") unless @@win
16
16
  end
17
17
 
18
18
  def setup
19
- @sparse_file = @@sun ? '/var/adm/lastlog' : '/var/log/lastlog'
19
+ @sparse_file = 'test_sparse'
20
20
  @non_sparse_file = File.expand_path(File.basename(__FILE__))
21
21
  end
22
22
 
@@ -46,4 +46,8 @@ class TC_IsSparse < Test::Unit::TestCase
46
46
  @sparse_file = nil
47
47
  @non_sparse_file = nil
48
48
  end
49
+
50
+ def self.shutdown
51
+ File.delete('test_sparse') if File.exist?('test_sparse')
52
+ end
49
53
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ptools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-25 00:00:00.000000000 Z
11
+ date: 2014-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: test-unit
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +52,7 @@ extra_rdoc_files:
38
52
  files:
39
53
  - ".gemtest"
40
54
  - CHANGES
55
+ - Gemfile
41
56
  - MANIFEST
42
57
  - README
43
58
  - Rakefile
@@ -80,22 +95,22 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
95
  - !ruby/object:Gem::Version
81
96
  version: '0'
82
97
  requirements: []
83
- rubyforge_project: shards
84
- rubygems_version: 2.2.2
98
+ rubyforge_project:
99
+ rubygems_version: 2.3.0
85
100
  signing_key:
86
101
  specification_version: 4
87
102
  summary: Extra methods for the File class
88
103
  test_files:
89
- - test/test_binary.rb
90
- - test/test_constants.rb
91
104
  - test/test_head.rb
92
- - test/test_image.rb
93
- - test/test_is_sparse.rb
94
105
  - test/test_middle.rb
95
- - test/test_nlconvert.rb
96
- - test/test_null.rb
97
106
  - test/test_tail.rb
98
- - test/test_touch.rb
99
107
  - test/test_wc.rb
100
- - test/test_whereis.rb
108
+ - test/test_is_sparse.rb
109
+ - test/test_null.rb
110
+ - test/test_touch.rb
101
111
  - test/test_which.rb
112
+ - test/test_whereis.rb
113
+ - test/test_binary.rb
114
+ - test/test_image.rb
115
+ - test/test_constants.rb
116
+ - test/test_nlconvert.rb