renumber 0.0.1 → 0.0.2

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: e86adecda7fa798289ec8c103c8266014be3d637
4
- data.tar.gz: 1441a15160eaa07dcfb0ba51fb32214462f57f43
3
+ metadata.gz: b3e6ccb17d5851f28e40ca9af9b2c561b3449401
4
+ data.tar.gz: 9d21d21d6a05b9f9c921ae671d1d752ef317b894
5
5
  SHA512:
6
- metadata.gz: e2559d025fbe4a25ec07a2a32c83f975dc85116c5eac19d574ef08cdf354e14f6ac0ac4d146dd20b3ac72eced91fa6c6f54c9bf8f44cbae755936220f8597497
7
- data.tar.gz: ad08063fdaed654beba5d2e834b5968162b40ef23f7fbfea397b113ef4f7501719a0c3b73240d347a385ab41aae69fef777dc972abedcdd77c279a4ec8adee18
6
+ metadata.gz: 999777a5ee83ed945afb2e133415d0fa2d17013a41e494d0d868a060e0fab4b02024d20285cbb54879a1676824b85b6948f95ecbac84d858276e24484814f94c
7
+ data.tar.gz: b0059134f6f8b9c3f2877d2d5a7140ad483b64c34fa9f3e711f6c606f525706fd43905ae0da6fe97c822e9bb92b6d33c2b16f303fd0af4e600c6030eb693dacc
data/README.md CHANGED
@@ -22,7 +22,14 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
+ ```ruby
26
+ require 'renumber'
27
+ include Renumber
28
+
29
+ sorted_files '.' # -> 0, 3, 4
25
30
 
31
+ change_files '.', 'prefix', '.txt' # -> prefix0.txt, prefix1.txt, prefix2.txt
32
+ ```
26
33
 
27
34
  ## Contributing
28
35
 
@@ -1,3 +1,3 @@
1
1
  module Renumber
2
- VERSION = "0.0.1"
2
+ VERSION = '0.0.2'
3
3
  end
data/lib/renumber.rb CHANGED
@@ -11,6 +11,8 @@ module Renumber
11
11
  sorted_files = sorted_files(path)
12
12
  return if sorted_files.length == 0
13
13
 
14
+ Dir.chdir(path)
15
+
14
16
  zeros_length = Math.log10(sorted_files.length).ceil
15
17
 
16
18
  sorted_files.each_with_index do |file, index|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: renumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Aschenbach