img-sort 0.1.0 → 0.1.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.
Files changed (5) hide show
  1. data/Rakefile +1 -1
  2. data/VERSION +1 -1
  3. data/img-sort.gemspec +2 -2
  4. data/lib/img-sort.rb +8 -4
  5. metadata +3 -3
data/Rakefile CHANGED
@@ -19,7 +19,7 @@ Jeweler::Tasks.new do |gem|
19
19
  gem.description = %Q{Sort images by their resolution and rename it if needed}
20
20
  gem.email = "with.out@me.com"
21
21
  gem.authors = ["Andrey Cherkashin"]
22
-
22
+ gem.executables = ['img-sort']
23
23
  gem.add_runtime_dependency 'rmagick'
24
24
  # Include your dependencies below. Runtime dependencies are required when using your gem,
25
25
  # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{img-sort}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andrey Cherkashin"]
12
- s.date = %q{2011-04-22}
12
+ s.date = %q{2011-04-25}
13
13
  s.description = %q{Sort images by their resolution and rename it if needed}
14
14
  s.email = %q{with.out@me.com}
15
15
  s.executables = ["img-sort"]
@@ -9,7 +9,7 @@ require 'rmagick'
9
9
  class ImgSort
10
10
  attr_reader :options
11
11
 
12
- VERSION="0.1.0"
12
+ VERSION=File.new("VERSION").gets
13
13
 
14
14
  def initialize(arguments = {})
15
15
  @arguments = arguments
@@ -26,7 +26,7 @@ class ImgSort
26
26
  # Parse options, check arguments, then process the command
27
27
  def run
28
28
 
29
- if parsed_options? && arguments_valid?
29
+ if (parsed_options? && arguments_valid?)
30
30
 
31
31
  @start_date = Time.now
32
32
  puts "Start at #{@start_date}\n" if @options.verbose
@@ -69,7 +69,12 @@ class ImgSort
69
69
 
70
70
 
71
71
  def parsed_options?
72
- @opt_parser.parse!(@arguments) rescue puts "Argument error.\nArguments: #{@arguments.inspect}\n" ; return false
72
+ begin
73
+ @opt_parser.parse!(@arguments)
74
+ rescue
75
+ puts "Argument error.\nArguments: #{@arguments.inspect}\n"
76
+ return false
77
+ end
73
78
  process_options
74
79
  true
75
80
  end
@@ -90,7 +95,6 @@ class ImgSort
90
95
 
91
96
  # True if required arguments were provided
92
97
  def arguments_valid?
93
- # TO DO - implement your real logic here
94
98
  true if (@arguments[0].is_a?(String) && @arguments[1].is_a?(String))
95
99
  end
96
100
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: img-sort
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Andrey Cherkashin
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-22 00:00:00 Z
13
+ date: 2011-04-25 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rmagick
@@ -114,7 +114,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- hash: -2357653575370366196
117
+ hash: 4570051595851012636
118
118
  segments:
119
119
  - 0
120
120
  version: "0"