crossbar 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +13 -0
- data/.gitignore +16 -0
- data/.scss-lint.yml +166 -0
- data/Gemfile +4 -0
- data/LICENSE.md +22 -0
- data/README.md +96 -0
- data/Rakefile +8 -0
- data/app/assets/stylesheets/base/_all.scss +24 -0
- data/app/assets/stylesheets/base/_button.scss +50 -0
- data/app/assets/stylesheets/base/_form.scss +99 -0
- data/app/assets/stylesheets/base/_image.scss +5 -0
- data/app/assets/stylesheets/base/_list.scss +34 -0
- data/app/assets/stylesheets/base/_table.scss +24 -0
- data/app/assets/stylesheets/base/_typography.scss +106 -0
- data/app/assets/stylesheets/base/extends/.keep +0 -0
- data/app/assets/stylesheets/base/functions/_colors.scss +33 -0
- data/app/assets/stylesheets/base/functions/_list-attributes.scss +10 -0
- data/app/assets/stylesheets/base/mixins/.keep +0 -0
- data/app/assets/stylesheets/base/variables/_colors.scss +23 -0
- data/app/assets/stylesheets/base/variables/_fonts.scss +0 -0
- data/app/assets/stylesheets/base/variables/_inputs.scss +22 -0
- data/app/assets/stylesheets/base/variables/_variables.scss +188 -0
- data/app/assets/stylesheets/base/vendor/normalize.css +427 -0
- data/app/assets/stylesheets/layout/_all.scss +0 -0
- data/app/assets/stylesheets/module/_all.scss +0 -0
- data/app/assets/stylesheets/state/_all.scss +0 -0
- data/bin/crossbar +5 -0
- data/crossbar.gemspec +27 -0
- data/lib/crossbar.rb +6 -0
- data/lib/crossbar/generator.rb +61 -0
- data/lib/crossbar/version.rb +3 -0
- data/spec/crossbar_spec.rb +16 -0
- data/spec/fixtures/application.css.scss +4 -0
- data/spec/spec_helper.rb +3 -0
- metadata +156 -0
data/lib/crossbar.rb
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'crossbar/version'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'pathname'
|
4
|
+
require 'thor'
|
5
|
+
|
6
|
+
module Crossbar
|
7
|
+
class Generator < Thor
|
8
|
+
map ['-v', '--version'] => :version
|
9
|
+
|
10
|
+
desc 'install', 'Install Crossbar into your project'
|
11
|
+
method_options path: :string
|
12
|
+
def install
|
13
|
+
# crossbar_files_already_installed?
|
14
|
+
if crossbar_files_already_installed?
|
15
|
+
puts "Crossbar files already installed, doing nothing."
|
16
|
+
else
|
17
|
+
install_files
|
18
|
+
puts "Crossbar files installed to #{install_path}/"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
desc 'version', 'Show Crossbar version'
|
23
|
+
def version
|
24
|
+
say "Crossbar #{Crossbar::VERSION}"
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def crossbar_files_already_installed?
|
30
|
+
crossbar_folders.all? do |f|
|
31
|
+
return File.directory?(File.join(install_path, f))
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def crossbar_folders
|
36
|
+
return ["base", "layout", "modules", "state"]
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
def install_path
|
41
|
+
Pathname.new(options[:path].to_s)
|
42
|
+
end
|
43
|
+
|
44
|
+
def install_files
|
45
|
+
FileUtils.mkdir_p(install_path)
|
46
|
+
FileUtils.cp_r(all_stylesheets, install_path)
|
47
|
+
end
|
48
|
+
|
49
|
+
def all_stylesheets
|
50
|
+
Dir["#{stylesheets_directory}/*"]
|
51
|
+
end
|
52
|
+
|
53
|
+
def stylesheets_directory
|
54
|
+
File.join(top_level_directory, "app", "assets", "stylesheets")
|
55
|
+
end
|
56
|
+
|
57
|
+
def top_level_directory
|
58
|
+
File.dirname(File.dirname(File.dirname(__FILE__)))
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'sass'
|
3
|
+
|
4
|
+
describe Crossbar do
|
5
|
+
after do
|
6
|
+
`rm -rf spec/fixtures/crossbar`
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'compiles to valid css' do
|
10
|
+
`crossbar install --path spec/fixtures/crossbar`
|
11
|
+
|
12
|
+
Sass.compile_file('spec/fixtures/application.css.scss', '/tmp/output.css')
|
13
|
+
|
14
|
+
expect(Pathname('/tmp/output.css')).to exist
|
15
|
+
end
|
16
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,156 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: crossbar
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- makabde
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-01-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
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
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sass
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: thor
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: After reading the book [SMACSS](https://smacss.com/) and finding it very
|
84
|
+
enlightening, I decided to compile this gem; using the lessons learned from the
|
85
|
+
book. Crossbar will scaffold a Sass structure with a basic set of sass variables
|
86
|
+
and styles for base elements.
|
87
|
+
email:
|
88
|
+
- hello@makabde.me
|
89
|
+
executables:
|
90
|
+
- crossbar
|
91
|
+
extensions: []
|
92
|
+
extra_rdoc_files: []
|
93
|
+
files:
|
94
|
+
- ".editorconfig"
|
95
|
+
- ".gitignore"
|
96
|
+
- ".scss-lint.yml"
|
97
|
+
- Gemfile
|
98
|
+
- LICENSE.md
|
99
|
+
- README.md
|
100
|
+
- Rakefile
|
101
|
+
- app/assets/stylesheets/base/_all.scss
|
102
|
+
- app/assets/stylesheets/base/_button.scss
|
103
|
+
- app/assets/stylesheets/base/_form.scss
|
104
|
+
- app/assets/stylesheets/base/_image.scss
|
105
|
+
- app/assets/stylesheets/base/_list.scss
|
106
|
+
- app/assets/stylesheets/base/_table.scss
|
107
|
+
- app/assets/stylesheets/base/_typography.scss
|
108
|
+
- app/assets/stylesheets/base/extends/.keep
|
109
|
+
- app/assets/stylesheets/base/functions/_colors.scss
|
110
|
+
- app/assets/stylesheets/base/functions/_list-attributes.scss
|
111
|
+
- app/assets/stylesheets/base/mixins/.keep
|
112
|
+
- app/assets/stylesheets/base/variables/_colors.scss
|
113
|
+
- app/assets/stylesheets/base/variables/_fonts.scss
|
114
|
+
- app/assets/stylesheets/base/variables/_inputs.scss
|
115
|
+
- app/assets/stylesheets/base/variables/_variables.scss
|
116
|
+
- app/assets/stylesheets/base/vendor/normalize.css
|
117
|
+
- app/assets/stylesheets/layout/_all.scss
|
118
|
+
- app/assets/stylesheets/module/_all.scss
|
119
|
+
- app/assets/stylesheets/state/_all.scss
|
120
|
+
- bin/crossbar
|
121
|
+
- crossbar.gemspec
|
122
|
+
- lib/crossbar.rb
|
123
|
+
- lib/crossbar/generator.rb
|
124
|
+
- lib/crossbar/version.rb
|
125
|
+
- spec/crossbar_spec.rb
|
126
|
+
- spec/fixtures/application.css.scss
|
127
|
+
- spec/spec_helper.rb
|
128
|
+
homepage: https://github.com/makabde/crossbar
|
129
|
+
licenses:
|
130
|
+
- MIT
|
131
|
+
metadata: {}
|
132
|
+
post_install_message:
|
133
|
+
rdoc_options: []
|
134
|
+
require_paths:
|
135
|
+
- lib
|
136
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
requirements: []
|
147
|
+
rubyforge_project:
|
148
|
+
rubygems_version: 2.4.5
|
149
|
+
signing_key:
|
150
|
+
specification_version: 4
|
151
|
+
summary: Crossbar scaffolds, in your project, a Sass project structure inspired by
|
152
|
+
SMACSS principles.
|
153
|
+
test_files:
|
154
|
+
- spec/crossbar_spec.rb
|
155
|
+
- spec/fixtures/application.css.scss
|
156
|
+
- spec/spec_helper.rb
|