where_to_cli 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTM4NjM2MGRkZTUwMGU3NjkyODdjOGJkNzE1OGUyMDU0ZjIyOWM3Nw==
4
+ M2MzMmY4Nzg1ZjdkMWFjMmRjNTA4OTFmMmY0NDE2ZTViMDRjNjdhMw==
5
5
  data.tar.gz: !binary |-
6
- MDJjOGQ2NzE2M2RlNjlhMzc4ZTA1NGRkZGIyZmMwNjVkZDlhZGQ3Yg==
6
+ YmUzNTFkNjYzNzg3ZjI5ZWI0YTVkYjcwYTJiNGMzZWQxZTkxMzJkZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDEwMmJlODljODAzMzFlNWEwNDhiZmZkYTgyNmMzNjk0NzBjYWUxY2Y1Mzhi
10
- MzRmODQzZDJjOGMyZWVlYzYzNDE5MWZjNjYyMzNiOTRkNTViOWQ3ODE0OTVh
11
- Yjc0MzQ0ZTQ5N2RjYWQ1ZWJjOTQxZTE4MzViOTUzMTBkNGE3OGQ=
9
+ OTQ1YTUwMThmNjY3M2JiNTVmNDUxNmJkMWRhNDc2ZjU0YTNlZTMwOTNhNDVl
10
+ NjIxMmM5OTQyYTk0N2VkNWViYjY0ODg2NWQxNjg3MjUxNWY2ZjM4MjRlMTJl
11
+ NGQ3NmE4NmViMjJiZjQ1YjRmYzIxMTg4MDI5NzI3YjA1MzM4NzM=
12
12
  data.tar.gz: !binary |-
13
- ZGJjNzJlNDkxODA4YTg3NTJmMDI2YTdhYTI1NTczMmM3NmFmMTI1MDg0MDAz
14
- OGJjODExZmYzZjJiNmY4ZjFjNTNjOGRkYmI5MDU4MjgwNmM3YzdmMGU1Y2Rm
15
- YzJkNDBkNjRmNzUxNWQ0MmMzNGFkNzU4ZGZjZDdlMmQwOTdjMDU=
13
+ ZjMxMGYzYzQ1NmNhNTUwNGMzYTEzMjE3ZjJiZGU1N2JlNjEzYzQ0MTZjODBj
14
+ ZjM0OTExNzMyY2JmN2VkZTg2NTdlN2Q4NGFiNjY0OTdlMThmYmQzMjcwOGY3
15
+ MjRhODBjNGJkZDQyN2VjOTJmYjY2OGY5ZjQ0MzMxZDJjMDZhMTM=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- where_to_cli (0.1.3)
4
+ where_to_cli (0.1.5)
5
5
  gli (= 2.13.1)
6
6
  where_to (~> 0.9.0, >= 0.9)
7
7
 
data/bin/whereto CHANGED
@@ -63,13 +63,14 @@ end
63
63
 
64
64
  def process(files)
65
65
  locator = WhereTo::Locator.new
66
- locator.series_title = prompt_for_series_title default: locator.series_title
66
+ locator.episode_number = 0
67
+ locator.series_title = prompt_for_series_title default: locator.series_title
67
68
 
68
69
  files.each do |file|
69
70
  puts ''
70
71
  puts "For file #{file}:"
71
72
  locator.season = prompt_for_season default: locator.season
72
- locator.episode_number = prompt_for_episode_number default: locator.episode_number
73
+ locator.episode_number = prompt_for_episode_number default: locator.episode_number.to_i + 1
73
74
  locator.group = prompt_for_group default: locator.group
74
75
 
75
76
  locator.lookup!
@@ -80,9 +81,7 @@ def process(files)
80
81
  puts "New filename: #{new_file}"
81
82
 
82
83
  if not @options[:dryrun]
83
- print 'Renaming...'
84
- FileUtils.mv file, new_file
85
- puts 'success!'
84
+ rename file, to: new_file
86
85
  else
87
86
  puts 'Skipping rename because of dryrun flag'
88
87
  end
@@ -90,6 +89,12 @@ def process(files)
90
89
  end
91
90
  end
92
91
 
92
+ def rename(from, to:)
93
+ print 'Renaming...'
94
+ FileUtils.mv from, to unless from == to
95
+ puts 'success!'
96
+ end
97
+
93
98
  def prompt_for_series_title(default: nil)
94
99
  return @options[:series] if @options[:series]
95
100
  prompt = "Enter a series title"
@@ -1,3 +1,3 @@
1
1
  module WhereToCli
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: where_to_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Toniazzo