shipd_style 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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/shipd_style/copy_directory.rb +19 -0
- data/lib/shipd_style/copy_stylesheets.rb +16 -6
- data/lib/shipd_style/shipd_style.rake +9 -2
- data/lib/shipd_style/version.rb +1 -1
- data/lib/shipd_style.rb +3 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9b3faf3acf3e5b49ff9356f4628daa71ea3f065
|
4
|
+
data.tar.gz: 51454b19c592e1c826f2be49209693250b94a4e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4a5a26463c3305595e1618e752c44d12eba2329214f9fee7cd3ea2d199d4ebca4396ca45802810938d5d2eabf7101ae1b913f318d50b27c22cc9925148e6651
|
7
|
+
data.tar.gz: 68b8d99f0c45bd9cbeeee8d4f02cb675cc158d9d1b4cbe7f3a303550b522c1806e3c9351ae696da87481f2ff683d614e9a2d34108574b4c01cbe81fca0e8e196
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
module ShipdStyle
|
2
|
+
class CopyDirectory < Struct.new(:new_path, :directory_name)
|
3
|
+
def perform
|
4
|
+
make_directory
|
5
|
+
# still using tick marks because of the * at the end of the path
|
6
|
+
`cp -r #{source_directory} #{new_path}`
|
7
|
+
end
|
8
|
+
|
9
|
+
def make_directory
|
10
|
+
FileUtils.mkdir_p(new_path) unless File.exist?(new_path)
|
11
|
+
end
|
12
|
+
|
13
|
+
def source_directory
|
14
|
+
File.expand_path(File.dirname(__FILE__) + "/../#{directory_name}/*" )
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
|
@@ -1,16 +1,26 @@
|
|
1
1
|
module ShipdStyle
|
2
2
|
class CopyStylesheets < Struct.new(:path)
|
3
3
|
def perform
|
4
|
-
|
5
|
-
`cp -r #{sass_directory} #{path}`
|
4
|
+
copier.perform
|
6
5
|
end
|
7
6
|
|
8
|
-
def
|
9
|
-
|
7
|
+
def remove_namespace
|
8
|
+
sass_path = copier.source_path
|
9
|
+
FileUtils.mv(sass_path + "/shipd-mobile.scss", sass_path + "/mobile.scss")
|
10
|
+
FileUtils.mv(sass_path + "/shipd-tablet.scss", sass_path + "/tablet.scss")
|
11
|
+
FileUtils.mv(sass_path + "/shipd-desktop.scss", sass_path + "/desktop.scss")
|
12
|
+
# inside contents have to be re-written too:
|
13
|
+
contents = File.read(sass_path + "/shipd-all.scss")
|
14
|
+
contents.gsub!("shipd-", "")
|
15
|
+
File.open(sass_path + "/all.scss", 'w+') do |f|
|
16
|
+
f.write contents
|
17
|
+
end
|
18
|
+
FileUtils.rm(sass_path + "/shipd-all.scss")
|
10
19
|
end
|
11
20
|
|
12
|
-
def
|
13
|
-
|
21
|
+
def copier
|
22
|
+
@copier ||= ShipdStyle::CopyDirectory.new(path, "sass")
|
14
23
|
end
|
15
24
|
end
|
16
25
|
end
|
26
|
+
|
@@ -1,9 +1,16 @@
|
|
1
|
+
require_relative 'copy_directory'
|
1
2
|
require_relative 'copy_stylesheets'
|
2
3
|
|
3
4
|
namespace :shipd_style do
|
4
|
-
desc "Copy all
|
5
|
+
desc "Copy all stylesheets to a directory"
|
5
6
|
task :copy_stylesheets, [:path] do |t, args|
|
6
|
-
path = args[:path] || `pwd
|
7
|
+
path = args[:path] || `pwd`.chomp
|
7
8
|
ShipdStyle::CopyStylesheets.new(path).perform
|
8
9
|
end
|
10
|
+
|
11
|
+
desc "Copy the templates to a directory"
|
12
|
+
task :copy_templates, [:path] do |t, args|
|
13
|
+
path = args[:path] || `pwd`.chomp
|
14
|
+
ShipdStyle::CopyDirectory.new(path, "templates").perform
|
15
|
+
end
|
9
16
|
end
|
data/lib/shipd_style/version.rb
CHANGED
data/lib/shipd_style.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shipd_style
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kane Baccigalupi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: compass
|
@@ -109,6 +109,7 @@ files:
|
|
109
109
|
- lib/sass/variables/_mixins.scss
|
110
110
|
- lib/sass/variables/_spacing.scss
|
111
111
|
- lib/shipd_style.rb
|
112
|
+
- lib/shipd_style/copy_directory.rb
|
112
113
|
- lib/shipd_style/copy_stylesheets.rb
|
113
114
|
- lib/shipd_style/shipd_style.rake
|
114
115
|
- lib/shipd_style/tasks.rb
|