dpm 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/Palette.json +4 -6
- data/bin/dpm +29 -13
- data/lib/dpm/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bb953d9de893f34e9d355f5781f211e9d983008
|
4
|
+
data.tar.gz: 02d314c4686b0428d34e99d7c75198e19adb11d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdc249f6788cd0b8d36ebf7d76bf954458f1b6bb620a2d68a1bbb4741fe554654d8deda3fbb07c12532b3979883d00de03dcd3282b38f796ef8aeb74a9a41d68
|
7
|
+
data.tar.gz: ca10451fa0e073a456b50a271cbf187f3bd6c8795fe0d310962f207a84d926ecbf936fe5d7a6a2a4efcec53a1b9ecadbd9c3ae060b7af3892f1a39835b660692
|
data/Gemfile.lock
CHANGED
data/Palette.json
CHANGED
data/bin/dpm
CHANGED
@@ -30,7 +30,6 @@ subcommand_option_handling :normal
|
|
30
30
|
|
31
31
|
# Constants
|
32
32
|
@sketch_plugins_dir = "#{Dir.home}/Library/Application Support/com.bohemiancoding.sketch3/Plugins/".gsub(/ /, '\ ')
|
33
|
-
@font_install_count = 0
|
34
33
|
@sketch_plugin_install_count = 0
|
35
34
|
|
36
35
|
# Begin setup
|
@@ -39,22 +38,25 @@ arg_name 'Describe arguments to list here'
|
|
39
38
|
command :install do |c|
|
40
39
|
c.desc 'Installs dependencies from a local Palette.json'
|
41
40
|
c.action do |global_options,options,args|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
if File.exists? local_palettefile
|
46
|
-
clean_palette_tmp_dir
|
47
|
-
install_fonts(local_palettefile)
|
48
|
-
install_sketch_plugins(local_palettefile)
|
49
|
-
puts "Palette complete. #{@font_install_count} fonts, #{@sketch_plugin_install_count} Sketch plugins now installed.".green
|
41
|
+
if args.first != nil
|
42
|
+
install_single_sketch_plugin(args.first)
|
50
43
|
else
|
51
|
-
|
44
|
+
working_directory = Dir.pwd
|
45
|
+
local_palettefile = "#{working_directory}/Palette.json"
|
46
|
+
|
47
|
+
if File.exists? local_palettefile
|
48
|
+
clean_palette_tmp_dir
|
49
|
+
install_sketch_plugins(local_palettefile)
|
50
|
+
puts "Palette complete. #{@sketch_plugin_install_count} Sketch plugins now installed.".green
|
51
|
+
else
|
52
|
+
raise "No Palette.json found.".red
|
53
|
+
end
|
52
54
|
end
|
53
55
|
end
|
54
56
|
end
|
55
57
|
|
56
58
|
desc 'Creates a sample Palette.json in the local directory'
|
57
|
-
command :
|
59
|
+
command :init do |c|
|
58
60
|
c.desc 'Creates a sample Palette.json in the local directory'
|
59
61
|
c.action do |global_options,options,args|
|
60
62
|
working_directory = Dir.pwd
|
@@ -67,7 +69,6 @@ command :touch do |c|
|
|
67
69
|
"name" => "My Project",
|
68
70
|
"author" => "",
|
69
71
|
"version" => "1.0",
|
70
|
-
"fonts" => [],
|
71
72
|
"sketch_plugins" => []
|
72
73
|
}
|
73
74
|
|
@@ -141,7 +142,7 @@ def install_sketch_plugins(local_palettefile)
|
|
141
142
|
|
142
143
|
if manifest['sketch_plugins']
|
143
144
|
manifest['sketch_plugins'].each do |plugin_url|
|
144
|
-
download_file(plugin_url, SecureRandom.hex)
|
145
|
+
download_file("https://github.com/#{plugin_url}/archive/master.zip", SecureRandom.hex)
|
145
146
|
end
|
146
147
|
|
147
148
|
puts "Installing Sketch plugins..."
|
@@ -158,6 +159,21 @@ def install_sketch_plugins(local_palettefile)
|
|
158
159
|
end
|
159
160
|
end
|
160
161
|
|
162
|
+
def install_single_sketch_plugin(args)
|
163
|
+
puts "Installing Sketch plugin #{args}..."
|
164
|
+
download_file("https://github.com/#{args}/archive/master.zip", SecureRandom.hex)
|
165
|
+
|
166
|
+
Dir.glob(".palette/**/*.sketchplugin").each do |unzipped_files|
|
167
|
+
parent = File.basename(File.expand_path("..", unzipped_files))
|
168
|
+
filename = File.basename(unzipped_files)
|
169
|
+
|
170
|
+
system "[ -d #{@sketch_plugins_dir}#{parent} ] || mkdir -p #{@sketch_plugins_dir}#{parent}"
|
171
|
+
system "cp -r #{unzipped_files.gsub(/ /, '\ ')} #{@sketch_plugins_dir}#{parent}/#{filename.gsub(/ /, '\ ')}"
|
172
|
+
end
|
173
|
+
|
174
|
+
puts "Installed Sketch plugins #{args}".green
|
175
|
+
end
|
176
|
+
|
161
177
|
def download_file(url, unique_id)
|
162
178
|
pbar = nil
|
163
179
|
uri = URI.parse(url)
|
data/lib/dpm/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dpm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alasdair Monk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
version: '0'
|
115
115
|
requirements: []
|
116
116
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.4.
|
117
|
+
rubygems_version: 2.4.8
|
118
118
|
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: A package manager for designers
|