tonic-wp 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cb06dafda09ebe86a973adfb926eb27ca8217690
4
+ data.tar.gz: d91733503cd937953b939227216a55582008c129
5
+ SHA512:
6
+ metadata.gz: 916a9447d9fcf784cd4590df5ab2288f0262f43c1b38548baa4883a3e697975ac29b5c9ecd973c9d6aed9a86abf85960171e6ddbea333146fc02a959a7b6167a
7
+ data.tar.gz: 47ce7c96313b6e35cf7c31424ec207704866f5cad822d094e3b007157d114ac5f1666411b7f203bc853d49af20380523813b87c934664692771919d38de15b09
@@ -0,0 +1,46 @@
1
+ Tonic WP
2
+ ---
3
+
4
+ ##An opinionated scaffolding structure for Sass and WordPress themes
5
+
6
+ Tonic WP is an opinionated framework for developing WordPress themes using Sass. It is simply meant to help keep your CSS modular by suggesting a file structure; no styles have been added. Tonic WP is meant to be imported after any grids, scaffolding or other framework styles.
7
+
8
+ ###Requirements
9
+
10
+ Sass 3.3+
11
+
12
+ ###Installation
13
+
14
+ Tonic WP includes an easy way to generate a directory with all necessary files.
15
+
16
+ ####Install (TonicWP v1.0)
17
+
18
+ ```
19
+ gem install tonic-wp
20
+ ```
21
+
22
+ Install TonicWP into the current directory by generating the `tonic-wp` folder:
23
+
24
+ ```
25
+ tonic-wp install
26
+ ```
27
+
28
+ The generated folder will contain all the scaffolding for getting started with your WordPress theme. These files are meant to be modified. If you remove any of the files, make sure they are removed from the `_tonic-wp.scss` file at the root of the `tonic-wp` folder so as not to cause any import errors.
29
+
30
+ You can specify a target directory using the `path` flag:
31
+
32
+ ```
33
+ tonic-wp install --path new/path
34
+ ```
35
+
36
+ ####Import
37
+
38
+ Make sure you import your newly generated framework into your stylesheet(s):
39
+
40
+ ```
41
+ @import 'tonic-wp/tonic-wp';
42
+ ```
43
+
44
+ ###License
45
+
46
+ Tonic WP is published under the [GNU General Public License](http://www.gnu.org/licenses/gpl-3.0.html).
@@ -0,0 +1,8 @@
1
+ require 'rake/testtask'
2
+
3
+ Rake::TestTask.new do |t|
4
+ t.libs << 'test'
5
+ end
6
+
7
+ desc "Run tests"
8
+ task :default => :test
@@ -0,0 +1,7 @@
1
+ @import 'layout/header';
2
+ @import 'layout/sidebar';
3
+ @import 'layout/footer';
4
+
5
+ @import 'layout/posts';
6
+ @import 'layout/posts-single';
7
+ @import 'layout/page';
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.dirname(__FILE__) + '/../lib/tonic-wp.rb'
4
+
5
+ TonicWP::Generator.start
Binary file
@@ -0,0 +1,13 @@
1
+ dir = File.dirname(__FILE__)
2
+ $LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
3
+
4
+ require "tonic-wp/generator"
5
+
6
+ unless defined?(Sass)
7
+ require 'sass'
8
+ end
9
+
10
+ module TonicWP
11
+ tonic_path = File.expand_path("../../app/assets/stylesheets", __FILE__)
12
+ ENV["SASS_PATH"] = [ENV["SASS_PATH"], tonic_path].compact.join(File::PATH_SEPARATOR)
13
+ end
@@ -0,0 +1,79 @@
1
+ require 'tonic-wp/version'
2
+ require 'fileutils'
3
+ require 'thor'
4
+
5
+ module TonicWP
6
+ class Generator < Thor
7
+ map ['-v', '--version'] => :version
8
+
9
+ desc 'install', 'Install TonicWP into your project'
10
+ method_options :path => :string, :force => :boolean
11
+ def install
12
+ if tonic_files_exist? && !options[:force]
13
+ puts "TonicWP files already installed. Doing nothing."
14
+ else
15
+ install_files
16
+ puts "TonicWP files installed to #{install_path}/"
17
+ end
18
+ end
19
+
20
+ desc 'update', 'Update TonicWP'
21
+ method_options :path => :string
22
+ def update
23
+ if tonic_files_exist?
24
+ remove_tonic_directory
25
+ install_files
26
+ puts "TonicWP files updated."
27
+ else
28
+ puts "No existing TonicWP installation. Doing nothing."
29
+ end
30
+ end
31
+
32
+ desc 'version', 'Show TonicWP version'
33
+ def version
34
+ say "TonicWP #{TonicWP::VERSION}"
35
+ end
36
+
37
+ private
38
+ def tonic_files_exist?
39
+ install_path.exist?
40
+ end
41
+
42
+ def install_path
43
+ @install_path ||= if options[:path]
44
+ Pathname.new(File.join(options[:path], 'tonic-wp'))
45
+ else
46
+ Pathname.new('tonic-wp')
47
+ end
48
+ end
49
+
50
+ def install_files
51
+ make_install_directory
52
+ copy_in_scss_files
53
+ end
54
+
55
+ def remove_tonic_directory
56
+ FileUtils.rm_rf("tonic-wp")
57
+ end
58
+
59
+ def make_install_directory
60
+ FileUtils.mkdir_p(install_path)
61
+ end
62
+
63
+ def copy_in_scss_files
64
+ FileUtils.cp_r(all_stylesheets, install_path)
65
+ end
66
+
67
+ def all_stylesheets
68
+ Dir["#{stylesheets_directory}/*"]
69
+ end
70
+
71
+ def stylesheets_directory
72
+ File.join(top_level_directory, "app", "assets", "stylesheets")
73
+ end
74
+
75
+ def top_level_directory
76
+ File.dirname(File.dirname(File.dirname(__FILE__)))
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,3 @@
1
+ module TonicWP
2
+ VERSION = "0.1.0"
3
+ end
File without changes
Binary file
@@ -0,0 +1,28 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+ require "tonic-wp/version"
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 'tonic-wp'
6
+ s.version = TonicWP::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ["Daniel Strunk"]
9
+ s.email = ["me@dstrunk.com"]
10
+ s.license = 'GNUv3'
11
+ s.homepage = "http://rubygems.org/gems/tonic-wp"
12
+ s.summary = "TonicWP Sass scaffolding for WordPress theme creation"
13
+ s.description = <<-DESC
14
+ Tonic-WP provides a basic Sass featureset designed to be as minimal as possible.
15
+ The gem is meant to provide a basic opinionated scaffolding for new WordPress themes.
16
+ In conjunction with a Yeoman generator, this build can provide everything needed to generate
17
+ necessary CSS files to get developers up to speed quickly and efficiently.
18
+ DESC
19
+
20
+ s.files = `git ls-files`.split("\n")
21
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
+ s.require_paths = ["lib"]
23
+
24
+ s.add_dependency('sass', '~> 3.3')
25
+ s.add_dependency('thor')
26
+
27
+ s.add_development_dependency('rake')
28
+ end
metadata ADDED
@@ -0,0 +1,109 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tonic-wp
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Daniel Strunk
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sass
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '3.3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '3.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: thor
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: |
56
+ Tonic-WP provides a basic Sass featureset designed to be as minimal as possible.
57
+ The gem is meant to provide a basic opinionated scaffolding for new WordPress themes.
58
+ In conjunction with a Yeoman generator, this build can provide everything needed to generate
59
+ necessary CSS files to get developers up to speed quickly and efficiently.
60
+ email:
61
+ - me@dstrunk.com
62
+ executables:
63
+ - tonic-wp
64
+ extensions: []
65
+ extra_rdoc_files: []
66
+ files:
67
+ - README.md
68
+ - Rakefile
69
+ - app/assets/stylesheets/_tonic-wp.scss
70
+ - app/assets/stylesheets/layout/_footer.scss
71
+ - app/assets/stylesheets/layout/_header.scss
72
+ - app/assets/stylesheets/layout/_page.scss
73
+ - app/assets/stylesheets/layout/_posts-single.scss
74
+ - app/assets/stylesheets/layout/_posts.scss
75
+ - app/assets/stylesheets/layout/_sidebar.scss
76
+ - bin/tonic-wp
77
+ - lib/.DS_Store
78
+ - lib/tonic-wp.rb
79
+ - lib/tonic-wp/generator.rb
80
+ - lib/tonic-wp/version.rb
81
+ - test/test_tonic-wp.rb
82
+ - tonic-wp-0.1.0.gem
83
+ - tonic-wp.gemspec
84
+ homepage: http://rubygems.org/gems/tonic-wp
85
+ licenses:
86
+ - GNUv3
87
+ metadata: {}
88
+ post_install_message:
89
+ rdoc_options: []
90
+ require_paths:
91
+ - lib
92
+ required_ruby_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ requirements: []
103
+ rubyforge_project:
104
+ rubygems_version: 2.1.11
105
+ signing_key:
106
+ specification_version: 4
107
+ summary: TonicWP Sass scaffolding for WordPress theme creation
108
+ test_files: []
109
+ has_rdoc: