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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1fcfe4745e1adb96b630b5135a75b3d32c9ba94b
4
- data.tar.gz: cf6f72cdde22a71e86a18040c35c9b6cdecf2ef8
3
+ metadata.gz: a9b3faf3acf3e5b49ff9356f4628daa71ea3f065
4
+ data.tar.gz: 51454b19c592e1c826f2be49209693250b94a4e7
5
5
  SHA512:
6
- metadata.gz: 154e4ed8c34022be1cee9e897be249c98906cbd98be1b85e2597f4436e726b36921219109682a42fcb799e5a9aae08461cd538a60a6fa5ef2172a8f722edd14d
7
- data.tar.gz: 441a3f6b33cdd0f8637e9cb42f9826136ca3c6297c89d1d6d01e4ddd802c58256fb05f34d57bf3accb57c34c36dcbf2e615eef8b8f2c925f191993f4d1fe7097
6
+ metadata.gz: f4a5a26463c3305595e1618e752c44d12eba2329214f9fee7cd3ea2d199d4ebca4396ca45802810938d5d2eabf7101ae1b913f318d50b27c22cc9925148e6651
7
+ data.tar.gz: 68b8d99f0c45bd9cbeeee8d4f02cb675cc158d9d1b4cbe7f3a303550b522c1806e3c9351ae696da87481f2ff683d614e9a2d34108574b4c01cbe81fca0e8e196
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shipd_style (0.1.0)
4
+ shipd_style (0.2.0)
5
5
  compass
6
6
 
7
7
  GEM
@@ -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
- make_directory
5
- `cp -r #{sass_directory} #{path}`
4
+ copier.perform
6
5
  end
7
6
 
8
- def make_directory
9
- `mkdir #{path}` unless File.exist?(path)
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 sass_directory
13
- File.expand_path(File.dirname(__FILE__) + "/../sass/*" )
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 the good stuff to a directory"
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
@@ -1,3 +1,3 @@
1
1
  module ShipdStyle
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/shipd_style.rb CHANGED
@@ -1,4 +1,7 @@
1
+ require 'fileutils'
2
+
1
3
  require "shipd_style/version"
4
+ require "shipd_style/copy_directory"
2
5
  require "shipd_style/copy_stylesheets"
3
6
 
4
7
  require "compass"
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.1.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-13 00:00:00.000000000 Z
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