toadstool 0.0.0.5 → 0.0.0.7

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.
@@ -14,94 +14,90 @@ module Toadstool
14
14
 
15
15
  # Define arguments and options
16
16
  argument :name, {:default => './'}
17
+ class_option :styleguide_directory, :type => :string, :default => "./styleguide/", :desc => 'The directory for the Toadstool app.'
17
18
 
18
19
  def self.source_root
19
20
  APP_PATH
20
21
  end
21
22
 
22
23
  def install_app
23
- # Per https://github.com/wycats/thor/pull/175#issuecomment-2250270
24
- # If any empty directory is found, it's copied and all .empty_directory files are ignored.
25
- # If any file name is wrapped within % signs, the text within the % signs will be executed
26
- # as a method and replaced with the returned value.
27
-
28
- directory "project/doc-src", "#{name}/doc-src"
29
- directory "project/public", "#{name}/public"
30
- directory "project/sass", "#{name}/sass"
31
- directory "project/views", "#{name}/views"
32
-
33
- copy_file "project/config.rb", "#{name}/config.rb"
34
- copy_file "project/config.ru", "#{name}/config.ru"
35
- copy_file "project/Gemfile", "#{name}/Gemfile"
36
- copy_file "project/Rakefile", "#{name}/Rakefile"
37
- copy_file "project/readme.md", "#{name}/readme.md"
38
- copy_file "project/toadstool.rb", "#{name}/toadstool.rb"
24
+ directory "project/doc-src", "#{install_directory}/doc-src"
25
+ directory "project/public", "#{install_directory}/public"
26
+ directory "project/sass", "#{install_directory}/sass"
27
+ directory "project/views", "#{install_directory}/views"
28
+
29
+ copy_file "project/config.rb", "#{install_directory}/config.rb"
30
+ copy_file "project/config.ru", "#{install_directory}/config.ru"
31
+ copy_file "project/Gemfile", "#{install_directory}/Gemfile"
32
+ copy_file "project/Rakefile", "#{install_directory}/Rakefile"
33
+ copy_file "project/readme.md", "#{install_directory}/readme.md"
34
+ copy_file "project/toadstool.rb", "#{install_directory}/toadstool.rb"
35
+ end
36
+
37
+ def install_directory
38
+ File.join('./', name, options[:styleguide_directory])
39
39
  end
40
40
  end
41
41
 
42
42
  class Server < Thor::Group
43
- def exec_script_rails!
43
+ def start # no desc
44
+
44
45
  cwd = Dir.pwd
45
- return unless in_rails_application? || in_rails_application_subdirectory?
46
- exec 'rackup', *ARGV if in_rails_application?
46
+ return unless in_toadstool_app? || in_app_subdirectory?
47
+ exec 'rackup', *ARGV if in_toadstool_app?
47
48
  Dir.chdir("..") do
48
49
  # Recurse in a chdir block: if the search fails we want to be sure
49
50
  # the application is generated in the original working directory.
50
- exec_script_rails! unless cwd == Dir.pwd
51
+ start! unless cwd == Dir.pwd
51
52
  end
52
53
  rescue SystemCallError
53
54
  # could not chdir, no problem just return
54
55
  end
55
-
56
- no_tasks do
57
- def in_rails_application?
58
- File.exists?('config.ru')
59
- end
60
56
 
57
+ no_tasks do
58
+ def in_toadstool_app?
59
+ File.exists?('toadstool.rb') && File.exists?('config.ru')
60
+ end
61
61
 
62
- def in_rails_application_subdirectory?(path = Pathname.new(Dir.pwd))
63
- File.exists?(File.join(path, 'config.ru')) || !path.root? && in_rails_application_subdirectory?(path.parent)
64
- end
65
- end
62
+ def in_app_subdirectory?(path = Pathname.new(Dir.pwd))
63
+ File.exists?(File.join(path, 'config.ru')) || !path.root? && in_app_subdirectory?(path.parent)
64
+ end
65
+ end
66
66
  end
67
-
68
-
69
67
 
70
- # end
71
- #
72
- #
73
- # module Toadstool
74
68
  class Generator < Thor
69
+ def self.source_root
70
+ APP_PATH
71
+ end
72
+
75
73
  include Thor::Actions
76
- argument :name
77
- argument :state
78
-
79
- desc 'ts_module', "Generate a module"
80
- def ts_module
81
- create_file "views/modules/#{name}/_#{state}.erb"
82
- create_file "views/modules/#{name}/readme.md"
83
- create_file "sass/modules/#{name}/#{state}/_#{state}.sass", "@import 'mixins'\n@import 'extends'"
84
- create_file "sass/modules/#{name}/#{state}/_extends.sass"
85
- create_file "sass/modules/#{name}/#{state}/_mixins.scss"
86
-
87
- create_file 'sass/_modules.sass' if !File.exist?('sass/_modules.sass')
88
-
89
- append_file 'sass/_modules.sass', "@import 'modules/#{name}/#{state}/#{state}'"
90
- end
74
+ argument :truffle
75
+ argument :oil
76
+
77
+ desc 'ts_module', "Generate a module"
78
+ def ts_module
79
+ directory "module/views", "views/modules/#{truffle}"
80
+ directory "module/sass", "sass/modules/#{truffle}"
81
+
82
+ append_file 'sass/_modules.scss', "@import 'modules/#{truffle}/#{oil}/#{oil}'"
83
+ end
91
84
 
92
- desc 'ts_pattern', "Generate a module"
93
- def ts_pattern
94
- create_file "views/ui_patterns/#{name}/_#{state}.erb"
95
- create_file "views/ui_patterns/#{name}/readme.md"
96
- create_file "sass/ui_patterns/#{name}/#{state}/_#{state}.sass", "@import 'mixins'\n@import 'extends'"
97
- create_file "sass/ui_patterns/#{name}/#{state}/_extends.sass"
98
- create_file "sass/ui_patterns/#{name}/#{state}/_mixins.scss"
99
-
100
- create_file 'sass/_ui_patterns.sass' if !File.exist?('sass/_ui_patterns.sass')
101
-
102
- append_file 'sass/_ui_patterns.sass', "@import 'ui_patterns/#{name}/#{state}/#{state}'"
85
+ desc 'pattern', "Generate a module"
86
+ def pattern
87
+ directory "pattern/views", "views/ui_patterns/#{truffle}"
88
+ directory "pattern/sass", "sass/ui_patterns/#{truffle}"
89
+
90
+ append_file 'sass/_ui_patterns.scss', "@import 'ui_patterns/#{truffle}/#{oil}/#{oil}'"
91
+ end
92
+
93
+ no_tasks do
94
+ def shiitake
95
+ "#{oil}"
103
96
  end
104
97
  end
98
+
99
+ map 'module' => 'ts_module'
100
+ end
105
101
  end
106
102
 
107
103
 
@@ -112,7 +108,8 @@ ARGV << '--help' if ARGV.empty?
112
108
  aliases = {
113
109
  "i" => "install",
114
110
  "new" => "install",
115
- "s" => "server"
111
+ "s" => "server",
112
+ "g" => "generate"
116
113
  }
117
114
 
118
115
 
@@ -135,7 +132,6 @@ when 'install'
135
132
  Toadstool::Install.start
136
133
  when 'server'
137
134
  Toadstool::Server.start
138
-
139
135
  when 'generate'
140
136
  Toadstool::Generator.start
141
137
  else
@@ -11,14 +11,7 @@
11
11
 
12
12
  // Following sequence will load the necessary Stipe libraries
13
13
  // ------------------------------------------------------------------------------
14
- @import "stipe/media";
15
- @import "stipe/stipe";
16
- @import "stipe/media";
17
- @import "stipe/typography";
18
- @import "stipe/grid";
19
- @import "stipe/forms";
20
- @import "stipe/color";
21
- @import "stipe/gradients";
14
+ @import "stipe/manifest";
22
15
 
23
16
 
24
17
 
@@ -1,8 +1,13 @@
1
1
  [class*="toadstool"] {
2
2
  .nav_toggle {
3
- @include linear_gradient_w3c ($alpha_gray, #{$delta_gray 0%, $alpha_gray 100%});
3
+ $nav_toggle_gradient: $delta_gray 0%, $alpha_gray 100%;
4
+ $nav_toggle_gradient_hover: $alpha_gray 0%, $delta_gray 100%;
5
+
6
+ @include linear_gradient_w3c ($alpha_gray, $nav_toggle_gradient);
7
+
8
+ //@include linear_gradient_w3c (#e4e4e4, #{#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%});
4
9
  &:hover {
5
- @include linear_gradient_w3c ($alpha_gray, #{$alpha_gray 0%, $delta_gray 100%});
10
+ @include linear_gradient_w3c ($alpha_gray, $nav_toggle_gradient_hover);
6
11
  border-color: $alpha_gray;
7
12
  box-shadow: 0 0 0;
8
13
  }
@@ -5,7 +5,9 @@
5
5
  font-weight: bold;
6
6
  @media #{$mobile} {
7
7
  @include flexbox(100%, auto, $orient: vertical);
8
- @include linear_gradient_w3c ($bravo_gray, #{$bravo_gray 30%,$delta_gray 100%});
8
+
9
+ $toadstool_nav_gradient: $bravo_gray 30%, $delta_gray 100%;
10
+ @include linear_gradient_w3c ($bravo_gray, $toadstool_nav_gradient);
9
11
  }
10
12
  }
11
13
  li {
@@ -26,7 +28,9 @@
26
28
  }
27
29
  a {
28
30
  color: $white;
29
- @include linear_gradient_w3c ($bravo_gray, #{$bravo_gray 50%,$delta_gray 100%});
31
+
32
+ $toadstool_nav_gradient: $bravo_gray 50%,$delta_gray 100%;
33
+ @include linear_gradient_w3c ($bravo_gray, $toadstool_nav_gradient);
30
34
  .no-flexbox & {
31
35
  padding: 0 em(10);
32
36
  }
@@ -0,0 +1,2 @@
1
+ @import 'mixins'
2
+ @import 'extends'
@@ -0,0 +1,2 @@
1
+ @import 'mixins'
2
+ @import 'extends'
@@ -1,9 +1,8 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
3
  gem 'sinatra'
4
+ gem 'sinatra-partial'
4
5
  gem 'sass'
5
6
  gem 'compass'
6
- gem 'sinatra-partial'
7
- gem 'rake'
8
7
  gem 'stipe'
9
8
  gem 'toadstool'
@@ -36,6 +36,5 @@
36
36
  @import "forms";
37
37
  @import "buttons";
38
38
  @import "design";
39
- @import "ui_patterns/example_pattern/example_pattern";
40
- @import "modules/example_module/example_module";
41
- @import "layouts/example_layout";
39
+ @import "ui_patterns";
40
+ @import "modules";
@@ -1,7 +1,7 @@
1
1
  # Those little ditties that Sinatra needs to make the magic happen
2
2
  # -----------------------------------------------------------------------
3
3
  require 'rubygems'
4
- require 'net/http'
4
+
5
5
 
6
6
  # If you're using bundler, you will need to add this
7
7
  require 'bundler/setup'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toadstool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0.5
4
+ version: 0.0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: lib/bin
12
12
  cert_chain: []
13
- date: 2013-02-21 00:00:00.000000000 Z
13
+ date: 2013-04-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sinatra
@@ -132,12 +132,16 @@ files:
132
132
  - lib/stylesheets/toadstool/ui_patterns/_color_grid.scss
133
133
  - lib/stylesheets/toadstool/ui_patterns/_emBox.scss
134
134
  - lib/stylesheets/toadstool/ui_patterns/_prettify.scss
135
- - lib/templates/module/sass/_example_module.scss
136
- - lib/templates/module/sass/_extends.scss
137
- - lib/templates/module/sass/_mixins.scss
138
- - lib/templates/module/views/module.erb
139
- - lib/templates/module/views/module.js
140
- - lib/templates/module/views/view.erb
135
+ - lib/templates/module/sass/%shiitake%/_%shiitake%.sass
136
+ - lib/templates/module/sass/%shiitake%/_extends.scss
137
+ - lib/templates/module/sass/%shiitake%/_mixins.scss
138
+ - lib/templates/module/views/_%shiitake%.erb
139
+ - lib/templates/module/views/readme.md
140
+ - lib/templates/pattern/sass/%shiitake%/_%shiitake%.sass
141
+ - lib/templates/pattern/sass/%shiitake%/_extends.scss
142
+ - lib/templates/pattern/sass/%shiitake%/_mixins.scss
143
+ - lib/templates/pattern/views/_%shiitake%.erb
144
+ - lib/templates/pattern/views/readme.md
141
145
  - lib/templates/project/config.rb
142
146
  - lib/templates/project/config.ru
143
147
  - lib/templates/project/doc-src/changelog.md
@@ -145,6 +149,7 @@ files:
145
149
  - lib/templates/project/doc-src/module-sass-readme.md
146
150
  - lib/templates/project/doc-src/SASS-Guidelines.md
147
151
  - lib/templates/project/Gemfile
152
+ - lib/templates/project/public/favicon.ico
148
153
  - lib/templates/project/public/images/toadstool-logo.png
149
154
  - lib/templates/project/public/javascripts/application.js
150
155
  - lib/templates/project/public/javascripts/jquery-1.8.3.min.js
@@ -159,8 +164,10 @@ files:
159
164
  - lib/templates/project/sass/_config.scss
160
165
  - lib/templates/project/sass/_design.scss
161
166
  - lib/templates/project/sass/_forms.scss
167
+ - lib/templates/project/sass/_modules.scss
162
168
  - lib/templates/project/sass/_reset.scss
163
169
  - lib/templates/project/sass/_typography.scss
170
+ - lib/templates/project/sass/_ui_patterns.scss
164
171
  - lib/templates/project/sass/buttons/_extends.scss
165
172
  - lib/templates/project/sass/buttons/_mixins.scss
166
173
  - lib/templates/project/sass/color/_color_defaults.scss
@@ -170,7 +177,6 @@ files:
170
177
  - lib/templates/project/sass/color/readme.md
171
178
  - lib/templates/project/sass/forms/_extends.scss
172
179
  - lib/templates/project/sass/forms/_mixins.scss
173
- - lib/templates/project/sass/layouts/_example_layout.scss
174
180
  - lib/templates/project/sass/readme.md
175
181
  - lib/templates/project/sass/style.scss
176
182
  - lib/templates/project/sass/toadstool.scss
@@ -210,10 +216,6 @@ files:
210
216
  - lib/templates/project/views/ui_patterns/readme.md
211
217
  - lib/templates/project/views/ui_patterns/typography/_body_copy.erb
212
218
  - lib/templates/project/views/ui_patterns/typography/_headings.erb
213
- - lib/templates/ui_pattern/sass/_example_pattern.scss
214
- - lib/templates/ui_pattern/sass/_extends.scss
215
- - lib/templates/ui_pattern/sass/_mixins.scss
216
- - lib/templates/ui_pattern/views/example.erb
217
219
  - lib/toadstool/version.rb
218
220
  - lib/toadstool.rb
219
221
  homepage: https://github.com/Anotheruiguy/toadstool
@@ -1,4 +0,0 @@
1
- @import "mixins";
2
- @import "extends";
3
-
4
- // -----------------------------------------
@@ -1,4 +0,0 @@
1
- @import "mixins";
2
- @import "extends";
3
-
4
- // -----------------------------------------
@@ -1 +0,0 @@
1
- example ui pattern to go here