desktop-boom 0.1.0 → 0.1.1
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 +4 -4
- data/bin/boom +39 -2
- data/lib/boom/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b5a72ed2ea65b432a037b97d4626ea3165ea89f
|
4
|
+
data.tar.gz: 3097c1e433946b9d5b987bbee3071ee2e7bf29f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5929abd50810d015ccfd514050d46a7cfdffde264c152fc44be80eff3d7dda4d4b7da6b51854f5d5e0980ac0310463ec08faea401e5ebc473837808778f2ad87
|
7
|
+
data.tar.gz: eed0714413941c63b19a7d259cf1971a9debc12edb5cc7b5f615a75be65653b2f8b0c7c7508d46ae84515f9f426b131ea9001368c87cf695074ae756aec3d19f
|
data/bin/boom
CHANGED
@@ -11,7 +11,7 @@ APP_NAME = 'boom'
|
|
11
11
|
DESKTOP_DIR = File.expand_path('~/Desktop/')
|
12
12
|
#TODO make configurable?
|
13
13
|
PROJECTS_DIRECTORY = "~/Documents/#{APP_NAME}/"
|
14
|
-
HELP_STRING = "#{APP_NAME} helps maintain your OS X desktop. Use APP_NAME so that your desktop
|
14
|
+
HELP_STRING = "#{APP_NAME} helps maintain your OS X desktop. Use #{APP_NAME} so that your desktop
|
15
15
|
only contains files and folders for the current project you are
|
16
16
|
working on.
|
17
17
|
|
@@ -22,7 +22,7 @@ later by #{APP_NAME} again.
|
|
22
22
|
Assuming you are current working on project `A`, to switch to the
|
23
23
|
project called `B`, run
|
24
24
|
|
25
|
-
$ APP_NAME B
|
25
|
+
$ #{APP_NAME} B
|
26
26
|
|
27
27
|
Files and folders in the desktop will be moved away and tagged as
|
28
28
|
belonging to project `A` and the files and folders for project `B`
|
@@ -120,6 +120,43 @@ command :list do |c|
|
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
123
|
+
command :rename do |c|
|
124
|
+
c.syntax = "#{APP_NAME} rename"
|
125
|
+
c.summary = 'Rename project'
|
126
|
+
c.description = c.summary
|
127
|
+
c.example 'Run command', "$ #{APP_NAME} rename <source> <target>"
|
128
|
+
c.action do |args, options|
|
129
|
+
puts "args: #{args}"
|
130
|
+
say_error "You must specify both the original project name and the new project name
|
131
|
+
$ #{APP_NAME} B
|
132
|
+
" and abort unless args.size == 2
|
133
|
+
File.open(config_path) do |f|
|
134
|
+
mapping = Psych.load(f.read)
|
135
|
+
projects_directory = mapping['projects_directory']
|
136
|
+
current_project = mapping['current_project']
|
137
|
+
projects = Dir.entries(File.expand_path(projects_directory)).reject {|e| e == '.' || e == '..' || !File.directory?(File.expand_path(e, projects_directory))}
|
138
|
+
source = args[0]
|
139
|
+
destination = args[1]
|
140
|
+
puts "current project: #{current_project}"
|
141
|
+
puts "projects: #{projects}"
|
142
|
+
puts "rename #{source} -> #{destination}"
|
143
|
+
#kkk check if source does not exist
|
144
|
+
say_error "Project does not exist: `#{source}`" and abort unless (projects + [current_project]).include? source
|
145
|
+
#kkk check if clash
|
146
|
+
say_error "There is an existing project with the name: `#{destination}`" and abort if (projects + [current_project]).include? destination
|
147
|
+
if current_project == source
|
148
|
+
say "rename current"
|
149
|
+
#kkk rename current
|
150
|
+
#switch_to(mapping, destination)
|
151
|
+
else
|
152
|
+
say "rename not current"
|
153
|
+
#kkk rename not current
|
154
|
+
#FileUtils.mv(File.expand_path(source, projects_directory), File.expand_path(destination, projects_directory))
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
123
160
|
def create_configuration_file
|
124
161
|
write_configuration(nil)
|
125
162
|
end
|
data/lib/boom/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: desktop-boom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hwee-Boon Yar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|