minable 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -0
  3. data/Gemfile +3 -0
  4. data/Gemfile.lock +52 -0
  5. data/LICENSE +51 -0
  6. data/Rakefile +9 -0
  7. data/app/assets/stylesheets/_global.scss +8 -0
  8. data/app/assets/stylesheets/_minable.scss +36 -0
  9. data/app/assets/stylesheets/_settings.scss +25 -0
  10. data/app/assets/stylesheets/_shame.scss +1 -0
  11. data/app/assets/stylesheets/components/_all.scss +6 -0
  12. data/app/assets/stylesheets/components/_containers.scss +1 -0
  13. data/app/assets/stylesheets/components/_footer.scss +1 -0
  14. data/app/assets/stylesheets/components/_header.scss +1 -0
  15. data/app/assets/stylesheets/components/_typography.scss +1 -0
  16. data/app/assets/stylesheets/framework/_all.scss +10 -0
  17. data/app/assets/stylesheets/framework/_normalize.scss +406 -0
  18. data/app/assets/stylesheets/framework/_typecsset.scss +340 -0
  19. data/app/assets/stylesheets/framework/grid/_all.scss +4 -0
  20. data/app/assets/stylesheets/framework/grid/_grid-core.scss +58 -0
  21. data/app/assets/stylesheets/framework/grid/_grid-unit.scss +195 -0
  22. data/app/assets/stylesheets/helpers/_all.scss +5 -0
  23. data/app/assets/stylesheets/helpers/classes/_all.scss +3 -0
  24. data/app/assets/stylesheets/helpers/classes/_display-classes.scss +33 -0
  25. data/app/assets/stylesheets/helpers/functions/_all.scss +3 -0
  26. data/app/assets/stylesheets/helpers/functions/_strip-unit.scss +4 -0
  27. data/app/assets/stylesheets/helpers/mixins/_all.scss +4 -0
  28. data/app/assets/stylesheets/helpers/mixins/_rem-fallback.scss +33 -0
  29. data/app/assets/stylesheets/helpers/mixins/_replace-text.scss +16 -0
  30. data/app/assets/stylesheets/modules/_all.scss +1 -0
  31. data/app/assets/stylesheets/templates/_404.scss +1 -0
  32. data/app/assets/stylesheets/templates/_all.scss +3 -0
  33. data/app/assets/stylesheets/templates/_home.scss +1 -0
  34. data/bin/minable +4 -0
  35. data/features/install.feature +29 -0
  36. data/features/step_definitions/minable_steps.rb +24 -0
  37. data/features/support/env.rb +1 -0
  38. data/features/support/minable_support.rb +19 -0
  39. data/features/update.feature +30 -0
  40. data/features/version.feature +6 -0
  41. data/lib/minable/engine.rb +4 -0
  42. data/lib/minable/generator.rb +80 -0
  43. data/lib/minable/version.rb +3 -0
  44. data/lib/minable.rb +27 -0
  45. data/lib/tasks/install.rake +20 -0
  46. data/minable.gemspec +28 -0
  47. data/readme.md +56 -0
  48. metadata +155 -0
@@ -0,0 +1,3 @@
1
+ // Templates are for indiviual page/template styling
2
+
3
+ @import "home";
@@ -0,0 +1 @@
1
+ // Homepage styling
data/bin/minable ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../lib/minable.rb'
3
+
4
+ Minable::Generator.start
@@ -0,0 +1,29 @@
1
+ @disable-bundler
2
+ Feature: Install minable files
3
+
4
+ Scenario: Minable generates a new minable installation
5
+ When I run `bundle exec minable install`
6
+ Then the sass directories should have been generated
7
+ And the following directories should exist:
8
+ | minable |
9
+ And the master minable partial should have been generated
10
+ And the output should contain "Minable files installed to minable/"
11
+
12
+ Scenario: Generating does not overwrite an existing minable directory
13
+ Given minable is already installed
14
+ When I run `bundle exec minable install`
15
+ Then the output should contain "Minable files already installed, doing nothing."
16
+
17
+ Scenario: Install Minable into a custom path
18
+ When I run `bundle exec minable install --path=custom_path`
19
+ Then the sass directories with "custom_path" prefix should have been generated
20
+ And the following directories should exist:
21
+ | custom_path/minable |
22
+ And the master minable partial should have been generated within "custom_path" directory
23
+ And the output should contain "Minable files installed to custom_path/minable/"
24
+
25
+ Scenario: Forcing install of minable
26
+ Given minable is already installed
27
+ When I run `bundle exec minable install --force`
28
+ Then the output from "bundle exec minable install --force" should contain "Minable files installed to minable/"
29
+ And the output should not contain "Minable files already installed, doing nothing."
@@ -0,0 +1,24 @@
1
+ Given /^minable is already installed$/ do
2
+ install_minable
3
+ end
4
+
5
+ Given /^I install minable to "([^"]*)"$/ do |path|
6
+ end
7
+
8
+ Then /^the sass directories(?: with "([^"]+)" prefix)? should have been generated$/ do |prefix|
9
+ sass_directories = ["components", "framework", "helpers", "modules", "templates"]
10
+ sass_directories.map!{ |directory| minable_path(prefix, directory) }
11
+ check_directory_presence(sass_directories, true)
12
+ end
13
+
14
+ Then /^the master minable partial should have been generated(?: within "([^"]+)" directory)?$/ do |prefix|
15
+ check_file_presence([minable_path(prefix, '_minable.scss')], true)
16
+ end
17
+
18
+ Then /^minable should not have been generated$/ do
19
+ check_directory_presence(['minable'], false)
20
+ end
21
+
22
+ Then /^the output should contain the current version of Minable$/ do
23
+ step %(the output should contain exactly "Minable #{Minable::VERSION}\n")
24
+ end
@@ -0,0 +1 @@
1
+ require "aruba/cucumber"
@@ -0,0 +1,19 @@
1
+ module MinableSupport
2
+ def install_minable(path = nil)
3
+ if path
4
+ run_simple("bundle exec minable install --path '#{path}'")
5
+ else
6
+ run_simple("bundle exec minable install")
7
+ end
8
+ end
9
+
10
+ def minable_path(prefix, path)
11
+ if prefix
12
+ File.join(prefix, 'minable', path)
13
+ else
14
+ File.join('minable', path)
15
+ end
16
+ end
17
+ end
18
+
19
+ World(MinableSupport)
@@ -0,0 +1,30 @@
1
+ @disable-bundler
2
+ Feature: Update minable files
3
+
4
+ Scenario: Updating updates an existing minable install
5
+ Given minable is already installed
6
+ When I write to "minable/_minable.scss" with:
7
+ """
8
+ foobar
9
+ """
10
+ And I run `bundle exec minable update`
11
+ Then the output should contain "Minable files updated."
12
+ And the file "minable/_minable.scss" should not contain "foobar"
13
+
14
+ Scenario: Updating with a --path option
15
+ Given I install minable to "custom_path"
16
+ When I write to "custom_path/minable/_minable.scss" with:
17
+ """
18
+ foobar
19
+ """
20
+ And I run `bundle exec minable update`
21
+ Then the output should contain "No existing minable installation. Doing nothing."
22
+
23
+ When I run `bundle exec minable update --path custom_path`
24
+ Then the output should contain "Minable files updated."
25
+ And the file "custom_path/minable/_minable.scss" should not contain "foobar"
26
+
27
+ Scenario: Updating does not generate a new minable install
28
+ And I run `bundle exec minable update`
29
+ Then minable should not have been generated
30
+ And the output should contain "No existing minable installation. Doing nothing."
@@ -0,0 +1,6 @@
1
+ @disable-bundler
2
+ Feature: Show version
3
+ Scenario: Viewing version
4
+ When I successfully run `bundle exec minable --version`
5
+ Then the output should contain the current version of Minable
6
+
@@ -0,0 +1,4 @@
1
+ module Minable
2
+ class Engine < Rails::Engine
3
+ end
4
+ end
@@ -0,0 +1,80 @@
1
+ require 'minable/version'
2
+ require "fileutils"
3
+ require 'thor'
4
+
5
+ module Minable
6
+ class Generator < Thor
7
+ map ['-v', '--version'] => :version
8
+
9
+ desc 'install', 'Install Minable into your project'
10
+ method_options :path => :string, :force => :boolean
11
+ def install
12
+ if minable_files_already_exist? && !options[:force]
13
+ puts "Minable files already installed, doing nothing."
14
+ else
15
+ install_files
16
+ puts "Minable files installed to #{install_path}/"
17
+ end
18
+ end
19
+
20
+ desc 'update', 'Update Minable'
21
+ method_options :path => :string
22
+ def update
23
+ if minable_files_already_exist?
24
+ remove_minable_directory
25
+ install_files
26
+ puts "Minable files updated."
27
+ else
28
+ puts "No existing minable installation. Doing nothing."
29
+ end
30
+ end
31
+
32
+ desc 'version', 'Show Minable version'
33
+ def version
34
+ say "Minable #{Minable::VERSION}"
35
+ end
36
+
37
+ private
38
+
39
+ def minable_files_already_exist?
40
+ install_path.exist?
41
+ end
42
+
43
+ def install_path
44
+ @install_path ||= if options[:path]
45
+ Pathname.new(File.join(options[:path], 'minable'))
46
+ else
47
+ Pathname.new('minable')
48
+ end
49
+ end
50
+
51
+ def install_files
52
+ make_install_directory
53
+ copy_in_scss_files
54
+ end
55
+
56
+ def remove_minable_directory
57
+ FileUtils.rm_rf("minable")
58
+ end
59
+
60
+ def make_install_directory
61
+ FileUtils.mkdir_p(install_path)
62
+ end
63
+
64
+ def copy_in_scss_files
65
+ FileUtils.cp_r(all_stylesheets, install_path)
66
+ end
67
+
68
+ def all_stylesheets
69
+ Dir["#{stylesheets_directory}/*"]
70
+ end
71
+
72
+ def stylesheets_directory
73
+ File.join(top_level_directory, "app", "assets", "stylesheets")
74
+ end
75
+
76
+ def top_level_directory
77
+ File.dirname(File.dirname(File.dirname(__FILE__)))
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,3 @@
1
+ module Minable
2
+ VERSION = "0.0.1"
3
+ end
data/lib/minable.rb ADDED
@@ -0,0 +1,27 @@
1
+ # CodeKit needs relative paths
2
+ dir = File.dirname(__FILE__)
3
+ $LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
4
+
5
+ require "minable/generator"
6
+
7
+ unless defined?(Sass)
8
+ require 'sass'
9
+ end
10
+
11
+ module Minable
12
+ if defined?(Rails) && defined?(Rails::Engine)
13
+ class Engine < ::Rails::Engine
14
+ require 'minable/engine'
15
+ end
16
+
17
+ module Rails
18
+ class Railtie < ::Rails::Railtie
19
+ rake_tasks do
20
+ load "tasks/install.rake"
21
+ end
22
+ end
23
+ end
24
+ else
25
+ Sass.load_paths << File.expand_path("../../app/assets/stylesheets", __FILE__)
26
+ end
27
+ end
@@ -0,0 +1,20 @@
1
+ # Needed for pre-3.1.
2
+
3
+ require "fileutils"
4
+ require "find"
5
+
6
+ namespace :minable do
7
+ desc "Move files to the Rails assets directory."
8
+ task :install, [:sass_path] do |t, args|
9
+ args.with_defaults(:sass_path => 'public/stylesheets/sass')
10
+ source_root = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
11
+ FileUtils.mkdir_p("#{Rails.root}/#{args.sass_path}/minable")
12
+ FileUtils.cp_r("#{source_root}/app/assets/stylesheets/.", "#{Rails.root}/#{args.sass_path}/minable", { :preserve => true })
13
+ Find.find("#{Rails.root}/#{args.sass_path}/minable") do |path|
14
+ if path.end_with?(".css.scss")
15
+ path_without_css_extension = path.gsub(/\.css\.scss$/, ".scss")
16
+ FileUtils.mv(path, path_without_css_extension)
17
+ end
18
+ end
19
+ end
20
+ end
data/minable.gemspec ADDED
@@ -0,0 +1,28 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "minable/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "minable"
7
+ s.version = Minable::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Joe Dinsdale", "Luke Barratt"]
10
+ s.email = ["mrjdinsdale@gmail.com"]
11
+ s.license = 'MIT'
12
+ s.homepage = "https://github.com/bolser/minable"
13
+ s.summary = "Sass Mixins using SCSS syntax."
14
+ s.description = <<-DESC
15
+ Minable is a minimal CSS framework written in SCSS.
16
+ DESC
17
+
18
+ s.files = `git ls-files`.split("\n")
19
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
+ s.require_paths = ["lib"]
22
+
23
+ s.add_dependency('sass', '>= 3.3.0.rc.2')
24
+ s.add_dependency('thor')
25
+
26
+ s.add_development_dependency('aruba', '~> 0.4')
27
+ s.add_development_dependency('rake')
28
+ end
data/readme.md ADDED
@@ -0,0 +1,56 @@
1
+ #Minable
2
+
3
+ Minable is a minimal CSS framework written in SCSS. It's based on Yahoo's [Pure CSS](http://purecss.io/) and thoughtbot's [Bourbon](http://bourbon.io/).
4
+
5
+ ## Requirements
6
+ Sass 3.2+
7
+
8
+ # SASS projects
9
+ Minable includes an easy way to generate a directory with all the necessary files.
10
+ For command line help: `$ minable help`
11
+
12
+ #### Install
13
+
14
+ gem install minable
15
+
16
+ Install Minable into the current directory by generating the `minable` folder:
17
+
18
+ minable install
19
+
20
+ The generated folder will contain all the mixins and other necessary Minable files. It is recommended not to add or modify the Minable files so that you can update Minable easily.
21
+
22
+ You can specify a target directory using the `path` flag:
23
+
24
+ minable install --path my/custom/path/
25
+
26
+ #### Import
27
+
28
+ Lastly, import the mixins at the beginning of your stylesheet(s):
29
+
30
+ @import 'minable/minable';
31
+
32
+ # Install for Rails 3.1+
33
+ In your Gemfile:
34
+
35
+ gem 'minable'
36
+
37
+ Then run:
38
+
39
+ $ bundle install
40
+
41
+ Restart your server. Then rename application`.css` to application`.css.scss`:
42
+
43
+ mv app/assets/stylesheets/application.css app/assets/stylesheets/application.css.scss
44
+
45
+ Delete the sprocket directive in application.css.scss.
46
+
47
+ *= require_tree .
48
+
49
+ Import Minable at the beginning of application.css.scss. All additional stylesheets must be imported below Minable:
50
+
51
+ @import "minable";
52
+
53
+ License
54
+ -------
55
+
56
+ Minable is Copyright © 2014 Joe Dinsdale. Bourbon is Copyright © 2011-2013 thoughtbot. Pure CSS is copyright 2014 Yahoo! Inc.
metadata ADDED
@@ -0,0 +1,155 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: minable
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Joe Dinsdale
8
+ - Luke Barratt
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-02-04 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: sass
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: 3.3.0.rc.2
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: 3.3.0.rc.2
28
+ - !ruby/object:Gem::Dependency
29
+ name: thor
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: aruba
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '0.4'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '0.4'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rake
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ description: |2
71
+ Minable is a minimal CSS framework written in SCSS.
72
+ email:
73
+ - mrjdinsdale@gmail.com
74
+ executables:
75
+ - minable
76
+ extensions: []
77
+ extra_rdoc_files: []
78
+ files:
79
+ - ".gitignore"
80
+ - Gemfile
81
+ - Gemfile.lock
82
+ - LICENSE
83
+ - Rakefile
84
+ - app/assets/stylesheets/_global.scss
85
+ - app/assets/stylesheets/_minable.scss
86
+ - app/assets/stylesheets/_settings.scss
87
+ - app/assets/stylesheets/_shame.scss
88
+ - app/assets/stylesheets/components/_all.scss
89
+ - app/assets/stylesheets/components/_containers.scss
90
+ - app/assets/stylesheets/components/_footer.scss
91
+ - app/assets/stylesheets/components/_header.scss
92
+ - app/assets/stylesheets/components/_typography.scss
93
+ - app/assets/stylesheets/framework/_all.scss
94
+ - app/assets/stylesheets/framework/_normalize.scss
95
+ - app/assets/stylesheets/framework/_typecsset.scss
96
+ - app/assets/stylesheets/framework/grid/_all.scss
97
+ - app/assets/stylesheets/framework/grid/_grid-core.scss
98
+ - app/assets/stylesheets/framework/grid/_grid-unit.scss
99
+ - app/assets/stylesheets/helpers/_all.scss
100
+ - app/assets/stylesheets/helpers/classes/_all.scss
101
+ - app/assets/stylesheets/helpers/classes/_display-classes.scss
102
+ - app/assets/stylesheets/helpers/functions/_all.scss
103
+ - app/assets/stylesheets/helpers/functions/_strip-unit.scss
104
+ - app/assets/stylesheets/helpers/mixins/_all.scss
105
+ - app/assets/stylesheets/helpers/mixins/_rem-fallback.scss
106
+ - app/assets/stylesheets/helpers/mixins/_replace-text.scss
107
+ - app/assets/stylesheets/modules/_all.scss
108
+ - app/assets/stylesheets/templates/_404.scss
109
+ - app/assets/stylesheets/templates/_all.scss
110
+ - app/assets/stylesheets/templates/_home.scss
111
+ - bin/minable
112
+ - features/install.feature
113
+ - features/step_definitions/minable_steps.rb
114
+ - features/support/env.rb
115
+ - features/support/minable_support.rb
116
+ - features/update.feature
117
+ - features/version.feature
118
+ - lib/minable.rb
119
+ - lib/minable/engine.rb
120
+ - lib/minable/generator.rb
121
+ - lib/minable/version.rb
122
+ - lib/tasks/install.rake
123
+ - minable.gemspec
124
+ - readme.md
125
+ homepage: https://github.com/bolser/minable
126
+ licenses:
127
+ - MIT
128
+ metadata: {}
129
+ post_install_message:
130
+ rdoc_options: []
131
+ require_paths:
132
+ - lib
133
+ required_ruby_version: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ required_rubygems_version: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
143
+ requirements: []
144
+ rubyforge_project:
145
+ rubygems_version: 2.2.1
146
+ signing_key:
147
+ specification_version: 4
148
+ summary: Sass Mixins using SCSS syntax.
149
+ test_files:
150
+ - features/install.feature
151
+ - features/step_definitions/minable_steps.rb
152
+ - features/support/env.rb
153
+ - features/support/minable_support.rb
154
+ - features/update.feature
155
+ - features/version.feature