fundler 0.1.0 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf4fd7f898311c26d2c07fd92c2905846e68c746
4
- data.tar.gz: a9ba71d7e459858563884adc3cb4f9bf139d9e64
3
+ metadata.gz: b35a3e9a00cac088bce3dea10e6f6b8f15b07bf2
4
+ data.tar.gz: 68eed8c72b01479b72ea7071237934bb29d8cb2b
5
5
  SHA512:
6
- metadata.gz: 8ec73e35ee9bfb8c3831431169eb6892b088c34d4c14d446cca4b458546d6b46b7a50f5099c61d65d765eb826decb77224da73aeaf6c0b479944c0659ea5c233
7
- data.tar.gz: d4b53e33572b8e94c57cdf795770801ed271f28cac04777f2addfa1b7c7c14c064407c8c3197dede958827add23439c592c20e57df0a8ea4bc08e7d370008cbb
6
+ metadata.gz: 7b5d6a62f8f3e909101f88a82088bfd1a98af37d1858c2450cc525aed0c5db3ed1719c7cc0fced1e294fdcd9dd01e0fbb237ad27ba4e4fc34b7b9e7514881234
7
+ data.tar.gz: fb72d4f7bcecf4dc5f66f4ea1f4d089c19b8b8e598a9767be15c8476fa46c23330221d34d82665bbf7f69b9fe8afe014204cd06aae6a9ace530106641ee37b4e
data/bin/fundler CHANGED
@@ -16,7 +16,7 @@ class FundlerProgram
16
16
  end
17
17
 
18
18
  def debug msg
19
- $stderr.puts "* debug: #{msg}"
19
+ $stderr.puts "* debug: #{msg}" if @debug
20
20
  end
21
21
 
22
22
  def fundler
@@ -26,12 +26,13 @@ class FundlerProgram
26
26
  def parse_options
27
27
  # Defaults
28
28
  @output = $stdout
29
+ @debug = false
29
30
 
30
31
  # Parser
31
32
  optparse = OptionParser.new do |opts|
32
- opts.banner = "Usage: #{opts.program_name} [OPTIONS] "
33
+ opts.banner = "Usage: #{opts.program_name} [OPTIONS] "
33
34
  opts.define_head 'file name cleaner'
34
- opts.separator ''
35
+ opts.separator ''
35
36
 
36
37
  opts.on('-d', '--debug', "Turn on debugging.") do
37
38
  @debug = true
@@ -42,6 +43,20 @@ class FundlerProgram
42
43
  @output = File.open(f, 'w') unless '-' == f
43
44
  end
44
45
 
46
+ opts.on('-c', '--clean_names',
47
+ 'clean, squeeze, downcase the filenames in pwd') do
48
+ debug "Cleaning the pwd: #{fundler.pwd}"
49
+ fundler.clean
50
+ end
51
+ opts.on('-l', '--list', 'listing files in pwd') do
52
+ debug "List files in #{fundler.pwd}"
53
+ fundler.list
54
+ end
55
+
56
+ opts.on('-b', '--bookmarks', 'a glance on firefox bookmarksdir') do
57
+ debug "Bookmarks util"
58
+ fundler.bookmarks
59
+ end
45
60
  opts.on_tail('-V', '--version', 'Show the version.') do
46
61
  $stderr.puts "#{opts.program_name} version: #{Fundler::VERSION}"
47
62
  exit
@@ -56,7 +71,7 @@ class FundlerProgram
56
71
  arguments = optparse.parse!
57
72
 
58
73
  if arguments.size == 0
59
- #err "You need to specify the directory"
74
+ # err "Argument needed!\n#{optparse.banner}"
60
75
  elsif arguments.size > 1
61
76
  err "You can only specify one directory a time"
62
77
  end
@@ -77,7 +92,6 @@ class FundlerProgram
77
92
  # @input.close
78
93
  # output_string = fundler.process(input_string)
79
94
  # @output.write output_string
80
- fundler.clean
81
95
  end
82
96
  end
83
97
 
data/fundler.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["edd.rossi@gmail.com"]
11
11
  spec.description = 'just an humble find/rename utility'
12
12
  spec.summary = 'find rename utility'
13
- spec.homepage = "https://github.com/zeroed/findler"
13
+ spec.homepage = "https://github.com/zeroed/fundler"
14
14
  spec.license = "GPL3"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
@@ -41,5 +41,26 @@ module FindAndClean
41
41
  Dir.pwd
42
42
  end
43
43
 
44
+ def get_list
45
+ out = ""
46
+ all_files.each do |file|
47
+ out << "- " << File.absolute_path(file)
48
+ out << " | " << File.atime(file).to_s
49
+ out << " | " << File.size(file).to_s
50
+ out << "\n"
51
+ end
52
+ puts out
53
+ end
54
+
55
+ MOZILLA_FIREFOX_CONF_DIR = File.expand_path('~') + '/.mozilla/firefox/'
56
+ def drop_bookmarks
57
+ dot_firefox = Dir.open(MOZILLA_FIREFOX_CONF_DIR)
58
+ profile_dir = dot_firefox.select {|dir| dir =~ /.*default/}
59
+ db_file = MOZILLA_FIREFOX_CONF_DIR + profile_dir.join + '/places.sqlite'
60
+ # require 'sqlite3'
61
+ # db = SQLite3::Database.new(profile_dir << '/' << 'places.sqlite')
62
+ puts FileUtils.cp(db_file, pwd)
63
+ end
64
+
44
65
  end #FindAndClean
45
66
 
@@ -1,5 +1,5 @@
1
1
  # coding: utf-8
2
2
  class Fundler
3
3
  # The version of the Fundler Utility.
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
data/lib/fundler.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'fundler/find_and_clean'
2
+ require 'fileutils'
2
3
 
3
4
  class Fundler
4
5
  include FindAndClean
@@ -8,4 +9,10 @@ class Fundler
8
9
  def pwd
9
10
  get_pwd
10
11
  end
12
+ def bookmarks
13
+ drop_bookmarks
14
+ end
15
+ def list
16
+ get_list
17
+ end
11
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - zeroed
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-20 00:00:00.000000000 Z
11
+ date: 2013-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -43,7 +43,6 @@ email:
43
43
  - edd.rossi@gmail.com
44
44
  executables:
45
45
  - fundler
46
- - fundler~
47
46
  extensions: []
48
47
  extra_rdoc_files: []
49
48
  files:
@@ -53,18 +52,14 @@ files:
53
52
  - README.md
54
53
  - Rakefile
55
54
  - bin/fundler
56
- - bin/fundler~
57
55
  - fundler.gemspec
58
- - fundler.gemspec~
59
56
  - lib/fundler.rb
60
- - lib/fundler.rb~
61
57
  - lib/fundler/find_and_clean.rb
62
58
  - lib/fundler/fundler_utils.rb
63
59
  - lib/fundler/version.rb
64
- - lib/fundler/version.rb~
65
60
  - spec/fundler_spec.rb
66
61
  - spec/fundler_spec.rb~
67
- homepage: https://github.com/zeroed/findler
62
+ homepage: https://github.com/zeroed/fundler
68
63
  licenses:
69
64
  - GPL3
70
65
  metadata: {}
@@ -91,4 +86,3 @@ summary: find rename utility
91
86
  test_files:
92
87
  - spec/fundler_spec.rb
93
88
  - spec/fundler_spec.rb~
94
- has_rdoc:
data/bin/fundler~ DELETED
@@ -1,89 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # -*- coding: utf-8 -*-
3
-
4
- # $: << File.expand_path('../../lib/', __FILE__) if File.directory?(File.expand_path('../../lib/', __FILE__))
5
-
6
- require 'findler'
7
- require 'optparse'
8
-
9
- class FindlerProgram
10
- attr_accessor :output
11
- attr_reader :input
12
-
13
- def err msg
14
- $stderr.puts "* error: #{msg}"
15
- exit 1
16
- end
17
-
18
- def debug msg
19
- $stderr.puts "* debug: #{msg}"
20
- end
21
-
22
- def findler
23
- @findler ||= Findler.new
24
- end
25
-
26
- def parse_options
27
- # Defaults
28
- @output = $stdout
29
-
30
- # Parser
31
- optparse = OptionParser.new do |opts|
32
- opts.banner = "Usage: #{opts.program_name} [OPTIONS] "
33
- opts.define_head 'file name cleaner'
34
- opts.separator ''
35
-
36
- opts.on('-d', '--debug', "Turn on debugging.") do
37
- @debug = true
38
- end
39
-
40
- opts.on('-o', '--output FILE', String,
41
- "Where to output the merged ruby script.") do |f|
42
- @output = File.open(f, 'w') unless '-' == f
43
- end
44
-
45
- opts.on_tail('-V', '--version', 'Show the version.') do
46
- $stderr.puts "#{opts.program_name} version: #{Findler::VERSION}"
47
- exit
48
- end
49
-
50
- opts.on_tail('-h', '--help', 'This Help.') do
51
- $stderr.puts opts
52
- exit
53
- end
54
- end
55
-
56
- arguments = optparse.parse!
57
-
58
- if arguments.size == 0
59
- #err "You need to specify the directory"
60
- elsif arguments.size > 1
61
- err "You can only specify one directory a time"
62
- end
63
-
64
- if '-' == arguments.first
65
- @input = $stdin
66
- else
67
- # @input = File.open(arguments.first, 'r')
68
- end
69
- end
70
-
71
- def run
72
- parse_options
73
- debug "Pwd: #{findler.pwd}"
74
- debug "Input: #{input.inspect}"
75
- debug "Output: #{output.inspect}"
76
- # input_string = @input.read
77
- # @input.close
78
- # output_string = findler.process(input_string)
79
- # @output.write output_string
80
- findler.clean
81
- end
82
- end
83
-
84
- #if __FILE__ == $0
85
- p Time.now
86
- FindlerProgram.new.run
87
- #end
88
-
89
- # EOF
data/fundler.gemspec~ DELETED
@@ -1,23 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'findler/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "findler"
8
- spec.version = Findler::VERSION
9
- spec.authors = ["zeroed"]
10
- spec.email = ["edd.rossi@gmail.com"]
11
- spec.description = 'just an humble find/rename utility'
12
- spec.summary = 'find rename utility'
13
- spec.homepage = "https://github.com/zeroed/findler"
14
- spec.license = "GPL3"
15
-
16
- spec.files = `git ls-files`.split($/)
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_development_dependency "bundler", "~> 1.3"
22
- spec.add_development_dependency "rake"
23
- end
@@ -1,5 +0,0 @@
1
- # coding: utf-8
2
- class Findler
3
- # The version of the Findler Utility.
4
- VERSION = "0.1.0"
5
- end
data/lib/fundler.rb~ DELETED
@@ -1,11 +0,0 @@
1
- require 'findler/find_and_clean'
2
-
3
- class Findler
4
- include FindAndClean
5
- def clean
6
- clean_all_filenames
7
- end
8
- def pwd
9
- get_pwd
10
- end
11
- end