droxi 0.0.2 → 0.0.3

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +44 -17
  3. data/droxi.gemspec +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd71a917fd5c4fd91e3193c2805df9759505ac95
4
- data.tar.gz: b5a4517dbc2ff604120b559919bc2750616acbfb
3
+ metadata.gz: a500f22213cbc90fc4c1513119b783927df1c8c6
4
+ data.tar.gz: bd09c71d16ceeba0be7b7bf145a60c3b5e89ddf9
5
5
  SHA512:
6
- metadata.gz: b547ebc0138aa9e79bcfd97b47a6809d2b63af71493b45e8cca19136b063f2f8fcf91c45216cdbdb617e7e05c1dbffb68d0bc33409ec6efae73ae5c91c21d658
7
- data.tar.gz: 43011ae5570b2eafcfbe7124a56f0422fe84136b6937e8a72d782e96887b952433f7f2ba1519912bc2c501e15e4e934f09dbbe0c0698dceffa4c0699cf875c77
6
+ metadata.gz: f242793872e450b07e68536096aaa4d337d4926c00be029805de4fa9c42eadd19b595da0432b1ebca2d03d8b75dcf5f3fa706eb2f2ffb413c9b50a53cc55a0e3
7
+ data.tar.gz: 2c0120dcf58351024453405c46e37e24565c4395c9a77a5fe00ce7e79d544b73982de8eba0e494de0eb9bbc4c8ccdf3d4484cd99c92782ee72191f2e368acad3
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- task :default => :test
1
+ task :default => :build
2
2
 
3
3
  desc 'run unit tests'
4
4
  task :test do
@@ -23,8 +23,20 @@ task :doc do
23
23
  sh 'rdoc `find lib -name *.rb`'
24
24
  end
25
25
 
26
- desc 'install man page (must have root permissions)'
27
- task :man do
26
+ desc 'build executable and man page'
27
+ task :build do
28
+ def build_exe
29
+ filenames = `find lib -name *.rb`.split + ['bin/droxi']
30
+
31
+ contents = "#!/usr/bin/env ruby\n\n"
32
+ contents << `cat -s #{filenames.join(' ')} \
33
+ | grep -v require_relative \
34
+ | grep -v "require 'droxi'"`
35
+
36
+ IO.write('build/droxi', contents)
37
+ File.chmod(0755, 'build/droxi')
38
+ end
39
+
28
40
  def date(gemspec)
29
41
  require 'time'
30
42
  Time.parse(/\d{4}-\d{2}-\d{2}/.match(gemspec)[0]).strftime('%B %Y')
@@ -46,23 +58,38 @@ task :man do
46
58
  sub('{version}', /\d+\.\d+\.\d+/.match(gemspec)[0]).
47
59
  sub('{commands}', commands)
48
60
 
49
- Dir.mkdir('build') unless Dir.exists?('build')
50
61
  IO.write('build/droxi.1', contents)
51
62
  end
52
63
 
53
- def install_page
54
- prefix = ENV['PREFIX'] || ENV['prefix'] || '/usr/local'
55
- install_path = "#{prefix}/share/man/man1"
56
-
57
- require 'fileutils'
58
- begin
59
- FileUtils.mkdir_p(install_path)
60
- FileUtils.cp('build/droxi.1', install_path)
61
- rescue
62
- puts 'Failed to install man page. This target must be run as root.'
63
- end
64
+ Dir.mkdir('build') unless Dir.exists?('build')
65
+ build_exe
66
+ build_page
67
+ end
68
+
69
+ PREFIX = ENV['PREFIX'] || ENV['prefix'] || '/usr/local'
70
+ BIN_PATH = "#{PREFIX}/bin"
71
+ MAN_PATH = "#{PREFIX}/share/man/man1"
72
+
73
+ desc 'install executable and man page'
74
+ task :install do
75
+ require 'fileutils'
76
+ begin
77
+ FileUtils.mkdir_p(BIN_PATH)
78
+ FileUtils.cp('build/droxi', BIN_PATH)
79
+ FileUtils.mkdir_p(MAN_PATH)
80
+ FileUtils.cp('build/droxi.1', MAN_PATH)
81
+ rescue Exception => error
82
+ puts error
64
83
  end
84
+ end
65
85
 
66
- build_page
67
- install_page
86
+ desc 'uninstall executable and man page'
87
+ task :uninstall do
88
+ require 'fileutils'
89
+ begin
90
+ FileUtils.rm("#{BIN_PATH}/droxi")
91
+ FileUtils.rm("#{MAN_PATH}/droxi.1")
92
+ rescue Exception => error
93
+ puts error
94
+ end
68
95
  end
data/droxi.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'droxi'
3
- s.version = '0.0.2'
3
+ s.version = '0.0.3'
4
4
  s.date = '2014-06-02'
5
5
  s.summary = 'ftp-like command-line interface to Dropbox'
6
6
  s.description = "A command-line Dropbox interface inspired by GNU \
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: droxi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mulcahy