poxy 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab8e506d4ee1222f50e10703d48adeb2e0db60b4
4
- data.tar.gz: 5fcafced632d122a96ef33cfc067a1a34e74c077
3
+ metadata.gz: 4396953384e6e15abf5c0e153648c4d422bbdc38
4
+ data.tar.gz: 8a7b860d9eb80a6f34032516afee526272d9e149
5
5
  SHA512:
6
- metadata.gz: 4e352ef9a6a65a9722862cd5d2aa46fd12fc24070f2f9bb6a99a0805e6c994a7cb0f0f38d9b449e08bd1fb76db6c94145ac48436996624f8241f081fdd3a7ce3
7
- data.tar.gz: 29b6382768d1b495c802c5ad4628739c99b3be1f2dd1de5f061a2564803d59c77b4a628e8bd7f7b7ffc810a88ad13c366039d03c7004e838e2bf1b369c1019e9
6
+ metadata.gz: 1217159ac28f8500744b6b51accd6c72e05c331ad7ba160ce5f2d7bad3117c2db8df0c09ce07ec9a698b6d5d5d0a4e090106c74fa2cab002990e6b2530e2d012
7
+ data.tar.gz: 7b578fa863269780d8539ee5c07e25435aedc9a80e6b7832e284840fad824545f00467318cd5ae320da9a14aac43cc32e1fe3aece362d35b36ea54ccb22edfdd
data/.gitignore CHANGED
@@ -1,17 +1,15 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
1
+ .DS_store
2
+ .sass-cache/
3
+ *.scssc
4
+ /stylesheets/.sass-cache/
5
+ _site/
6
+ _includes/
7
+ _layouts/
8
+ _sass/
9
+ examples/
10
+ images/
11
+ css/
12
+ _config.yml
13
+ index.html
12
14
  pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
15
+ Gemfile.lock
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format documentation
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,35 @@
1
+ We love pull requests. Here's a quick guide:
2
+
3
+ 1. Fork the repository.
4
+ 2. Make your changes in a topic branch.
5
+ 3. Run `rake` to see if you changes are breaking any existing functionality.
6
+ 3. Squash your commits into a single one (more on that [here](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html)).
7
+ 4. Rebase against `origin/master`, push to your fork and submit a pull request.
8
+
9
+ At this point you're waiting on us. We like to at least comment on, if not
10
+ accept, pull requests within three business days (and, typically, one business
11
+ day). We may suggest some changes or improvements or alternatives.
12
+
13
+ Some things that will increase the chance that your pull request is accepted:
14
+
15
+ * Fix a bug, refactor code or expand an existing feature.
16
+ * Write [RSpec](https://www.relishapp.com/rspec) tests for your new features.
17
+ * Use the right syntax and naming conventions.
18
+ * Update parts of the documentation that are affected by your contribution.
19
+
20
+ **Git Commit Messages**
21
+
22
+ * Capitalize your commit messages.
23
+ * Start your message with a verb.
24
+ * Use present tense.
25
+ * Refer to the issue/PR number in your squashed commit message.
26
+
27
+ **SCSS Style Guide**
28
+
29
+ * Two spaces, no tabs.
30
+ * Dashes instead of underscores or camel case: `span-columns` **not** `span_columns` or `spanColumns`
31
+ * Names should be descriptive and written in full-words: `$visual-grid-color` **not** `$color` or `$vslgrd-clr`
32
+ * Space between property and value: `width: 20px` **not** `width:20px`
33
+ * Declarations within a block should be ordered alphabetically.
34
+ * Blank lines between rules.
35
+ * No trailing whitespace. Blank lines should not have any space.
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
1
+ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in poxy.gemspec
4
4
  gemspec
data/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ LICENSE
2
+
3
+ The MIT License
4
+
5
+ Copyright (c) 2012-2014 Paul Wood Design, LLC.
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
data/NEWS.md ADDED
@@ -0,0 +1,5 @@
1
+
2
+
3
+ ### 0.0.0 (2014-04-10)
4
+
5
+ * Figuring out how to share my framework on GitHub.
data/Rakefile CHANGED
@@ -1 +1,22 @@
1
- require "bundler/gem_tasks"
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ require 'rspec/core/rake_task'
4
+ Bundler::GemHelper.install_tasks
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task :default => :spec
9
+
10
+ task :test do
11
+ puts "Creating a Bourbon directory..."
12
+ `bourbon install --path test`
13
+ puts "Generating CSS..."
14
+ `sass -I . --watch test:css/ --style expanded`
15
+ end
16
+
17
+ task :clean do
18
+ puts "Deleting Bourbon directory..."
19
+ `rm -rf test/bourbon`
20
+ puts "Deleting generated CSS..."
21
+ `rm -rf css/`
22
+ end
@@ -0,0 +1,9 @@
1
+ // Poxy 0.0.1.pre
2
+ // MIT Licensed
3
+ // Copyright (c) 2013-2014 Paul Wood Design, LLC
4
+
5
+ section, header{width:100%; display:block; margin:0; padding:0;}
6
+ .site-width{width:100%; margin:0 auto; @include inline-block();}
7
+ .copy-width{display:block;}
8
+ .copy-inside{display:inline-block;}
9
+ .clearboth {clear:both;display:block;font-size:0;height:0;line-height:0;width:100%;}
data/bin/poxy ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "poxy"
4
+
5
+ Poxy::Generator.new(ARGV).run
data/bower.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "poxy",
3
+ "version": "0.0.1",
4
+ "homepage": "http://poxy.io/",
5
+ "main": "app/assets/stylesheets/_poxy.scss",
6
+ "ignore": [
7
+ "bin",
8
+ "lib",
9
+ ".gitignore",
10
+ "Gemfile",
11
+ "Gemfile.lock",
12
+ "Rakefile",
13
+ "poxy.gemspec",
14
+ "CONTRIBUTING.md",
15
+ "NEWS.md"
16
+ ],
17
+ "dependencies": {
18
+ "bourbon": ">=3.1"
19
+ }
20
+ }
@@ -0,0 +1,5 @@
1
+ module Poxy
2
+ class Engine < Rails::Engine
3
+ # auto wire
4
+ end
5
+ end
@@ -0,0 +1,74 @@
1
+ require "fileutils"
2
+
3
+ module Poxy
4
+ class Generator
5
+ def initialize(arguments)
6
+ @subcommand = arguments.first
7
+ end
8
+
9
+ def run
10
+ if @subcommand == "install"
11
+ install
12
+ elsif @subcommand == "update"
13
+ update
14
+ elsif @subcommand == "remove"
15
+ remove
16
+ end
17
+ end
18
+
19
+ def update
20
+ if poxy_files_already_exist?
21
+ remove_poxy_directory
22
+ install_files
23
+ puts "Poxy files updated."
24
+ else
25
+ puts "No existing poxy installation. Doing nothing."
26
+ end
27
+ end
28
+
29
+ def install
30
+ if poxy_files_already_exist?
31
+ puts "Poxy files already installed, doing nothing."
32
+ else
33
+ install_files
34
+ puts "Poxy files installed to poxy/"
35
+ end
36
+ end
37
+
38
+ def remove
39
+ if poxy_files_already_exist?
40
+ remove_poxy_directory
41
+ puts "Poxy was successfully removed."
42
+ else
43
+ puts "No existing poxy installation. Doing nothing."
44
+ end
45
+ end
46
+
47
+ private
48
+
49
+ def poxy_files_already_exist?
50
+ File.directory?("poxy")
51
+ end
52
+
53
+ def install_files
54
+ FileUtils.mkdir_p("poxy")
55
+ FileUtils.cp_r(all_stylesheets, "poxy/")
56
+ end
57
+
58
+ def remove_poxy_directory
59
+ FileUtils.rm_rf("poxy")
60
+ end
61
+
62
+ def all_stylesheets
63
+ Dir["#{stylesheets_directory}/*"]
64
+ end
65
+
66
+ def stylesheets_directory
67
+ File.join(top_level_directory, "app", "assets", "stylesheets")
68
+ end
69
+
70
+ def top_level_directory
71
+ File.dirname(File.dirname(File.dirname(__FILE__)))
72
+ end
73
+ end
74
+ end
data/lib/poxy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Poxy
2
- VERSION = "0.0.3"
2
+ VERSION = '0.0.2'
3
3
  end
data/lib/poxy.rb CHANGED
@@ -1,7 +1,5 @@
1
- require "poxy/version"
2
-
3
1
  require "bourbon"
4
- #require "poxy/generator"
2
+ require "poxy/generator"
5
3
 
6
4
  module Poxy
7
5
  if defined?(Rails) && defined?(Rails::Engine)
@@ -19,4 +17,4 @@ module Poxy
19
17
  else
20
18
  Sass.load_paths << File.expand_path("../../app/assets/stylesheets", __FILE__)
21
19
  end
22
- end
20
+ end
@@ -0,0 +1,21 @@
1
+ require "fileutils"
2
+ require "find"
3
+
4
+ namespace :bourbon do
5
+ namespace :poxy do
6
+ desc "Copy Poxy's files to the Rails assets directory."
7
+ task :install, [:sass_path] do |t, args|
8
+ args.with_defaults(:sass_path => 'public/stylesheets/sass')
9
+ source_root = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
10
+ FileUtils.mkdir_p("#{Rails.root}/#{args.sass_path}/poxy")
11
+ FileUtils.cp_r("#{source_root}/app/assets/stylesheets/.", "#{Rails.root}/#{args.sass_path}/poxy", { :preserve => true })
12
+
13
+ Find.find("#{Rails.root}/#{args.sass_path}/poxy") 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
21
+ end
data/poxy.gemspec CHANGED
@@ -1,28 +1,34 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path('../lib', __FILE__)
4
3
  require 'poxy/version'
5
4
 
6
- Gem::Specification.new do |spec|
7
- spec.name = "poxy"
8
- spec.version = Poxy::VERSION
9
- spec.authors = ["Paul Wood"]
10
- spec.email = ["paulwooddesign@gmail.com"]
11
- spec.description = %q{A responsive fixed width grid framework built on top of Sass based on the Frameless Grid by Joni Korpi}
12
- spec.summary = %q{A responsive fixed width grid framework built on top of Sass based on the Frameless Grid by Joni Korpi}
13
- spec.homepage = "https://github.com/paulwooddesign/poxy"
14
- spec.license = "MIT"
5
+ Gem::Specification.new do |s|
6
+ s.name = 'poxy'
7
+ #s.version = poxy::VERSION
8
+ s.version = '0.0.4'
9
+ s.platform = Gem::Platform::RUBY
10
+ s.authors = ['Paul Wood']
11
+ s.email = ['paulwooddesign@gmail.com']
12
+ s.homepage = 'https://github.com/paulwooddesign/poxy'
13
+ s.summary = 'A responsive fixed width grid framework built on top of Sass based on the Frameless Grid by Joni Korpi'
14
+ s.license = 'MIT'
15
+ s.description = 'A responsive fixed width grid framework built on top of Sass based on the Frameless Grid by Joni Korpi'
15
16
 
16
- spec.files = `git ls-files`.split($/)
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
17
+ s.rubyforge_project = 'poxy'
20
18
 
21
- spec.add_dependency('sass', '>= 3.2')
22
- spec.add_dependency('bourbon', '>= 3.1')
19
+ s.files = `git ls-files`.split("\n")
20
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
+ s.require_paths = ['lib']
23
23
 
24
+ s.add_dependency('sass', '>= 3.2')
25
+ s.add_dependency('bourbon', '>= 3.1')
24
26
 
25
- spec.add_development_dependency('css_parser')
26
- spec.add_development_dependency "bundler", "~> 1.3"
27
- spec.add_development_dependency "rake"
27
+ s.add_development_dependency('aruba', '~> 0.5.0')
28
+ s.add_development_dependency('rake')
29
+ s.add_development_dependency('css_parser')
30
+ s.add_development_dependency('rspec')
31
+ s.add_development_dependency('rdoc')
32
+ s.add_development_dependency('bundler')
33
+ s.add_development_dependency('rb-fsevent', '~> 0.9.1')
28
34
  end
@@ -0,0 +1,73 @@
1
+ require 'spec_helper'
2
+
3
+ describe "@include span-columns()" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("span-columns")
6
+ end
7
+
8
+ context "with argument (6) in a twelve-column grid" do
9
+ it "sets width in percentage" do
10
+ expect('.span-columns-default').to have_rule('width: 48.82117%')
11
+ end
12
+
13
+ it "sets gutter in percentage" do
14
+ expect('.span-columns-default').to have_rule('margin-right: 2.35765%')
15
+ end
16
+
17
+ it "sets display to block" do
18
+ expect('.span-columns-default').to have_rule('display: block')
19
+ end
20
+
21
+ it "sets float to left" do
22
+ expect('.span-columns-default').to have_rule('float: left')
23
+ end
24
+
25
+ it "removes gutter from last element" do
26
+ expect('.span-columns-default:last-child').to have_rule('margin-right: 0')
27
+ end
28
+ end
29
+
30
+ context "when nested" do
31
+ it "sets relative width in percentage" do
32
+ expect('.span-columns-default .span-columns-nested').to have_rule('width: 30.11389%')
33
+ end
34
+
35
+ it "sets relative gutter in percentage" do
36
+ expect('.span-columns-default .span-columns-nested').to have_rule('margin-right: 4.82916%')
37
+ end
38
+ end
39
+
40
+ context "with argument (table)" do
41
+ it "sets display to table-cell" do
42
+ expect('.span-columns-table').to have_rule('display: table-cell')
43
+ end
44
+
45
+ it "sets width evenly between elements" do
46
+ expect('.span-columns-table').to have_rule('width: 50%')
47
+ end
48
+ end
49
+
50
+ context "with argument (block-collapse)" do
51
+ it "appends gutter width to column width" do
52
+ expect('.span-columns-collapse').to have_rule('width: 51.17883%')
53
+ end
54
+
55
+ it "removes the next gutter" do
56
+ expect('.span-columns-collapse').to_not have_rule('margin-right: 2.35765%')
57
+ end
58
+
59
+ it "removes gutter percentage from the width of the last child" do
60
+ expect('.span-columns-collapse:last-child').to have_rule('width: 48.82117%')
61
+ end
62
+ end
63
+
64
+ context "with argument (no-display)" do
65
+ it "doesn't set display property" do
66
+ expect('.span-columns-no-display').to_not have_rule('display: block')
67
+ end
68
+
69
+ it "sets width in percentage based on a block layout" do
70
+ expect('.span-columns-no-display').to have_rule('width: 48.82117%')
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe "@include outer-container()" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("outer-container")
6
+ end
7
+
8
+ it "adds clearfix" do
9
+ expect('.container-default:after').to have_rule('clear: both')
10
+ end
11
+
12
+ it "sets max-width" do
13
+ expect('.container-default').to have_rule('max-width: 960px')
14
+ end
15
+ end
@@ -0,0 +1,55 @@
1
+ require 'spec_helper'
2
+
3
+ describe "@include media()" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("media")
6
+ end
7
+
8
+ context "with argument (481px)" do
9
+ it "outputs @media screen and (min-width: 481px)" do
10
+ expect('.media-default').to be_contained_in('screen and (min-width: 481px)')
11
+ end
12
+ end
13
+
14
+ context "with argument (max-width 480px)" do
15
+ it "outputs @media screen and (max-width: 480px)" do
16
+ expect('.media-max-width').to be_contained_in('screen and (max-width: 480px)')
17
+ end
18
+ end
19
+
20
+ context "with argument (min-width 320px max-width 480px)" do
21
+ it "outputs @media screen and (min-width: 320px) and (max-width: 480px)" do
22
+ expect('.media-min-max-width').to be_contained_in('screen and (min-width: 320px) and (max-width: 480px)')
23
+ end
24
+ end
25
+
26
+ context "with argument (481px, 6)" do
27
+ it "outputs @media screen and (min-width: 481px)" do
28
+ expect('.change-media-context').to be_contained_in('screen and (min-width: 481px)')
29
+ end
30
+
31
+ it "uses a 6-column grid" do
32
+ expect('.change-media-context').to have_rule('width: 100%')
33
+ end
34
+ end
35
+
36
+ context "with shorthand argument (max-width 480px 6)" do
37
+ it "outputs @media screen and (max-width: 480px)" do
38
+ expect('.change-media-context-shorthand').to be_contained_in('screen and (max-width: 480px)')
39
+ end
40
+
41
+ it "uses a 6-column grid" do
42
+ expect('.change-media-context-shorthand').to have_rule('width: 100%')
43
+ end
44
+ end
45
+
46
+ context "with composite argument (max-width 768px min-width 110px orientation portait 6)" do
47
+ it "outputs @media screen and (max-width: 768px) and (min-width: 110px) and (orientation: portait)" do
48
+ expect('.composite-media-query').to be_contained_in('screen and (max-width: 768px) and (min-width: 110px) and (orientation: portait)')
49
+ end
50
+
51
+ it "uses a 6-column grid" do
52
+ expect('.composite-media-query').to have_rule('width: 100%')
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ describe "new-breakpoint()" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("new-breakpoint")
6
+ end
7
+
8
+ context "with argument (max-width 768px 12)" do
9
+ it "outputs (max-width 768px)" do
10
+ expect('.responsive-element').to be_contained_in('screen and (max-width: 768px)')
11
+ end
12
+
13
+ it "adds (max-width 768px 12) to visual grid breakpoints" do
14
+ expect('$visual-grid-breakpoints').to have_value('max-width 768px 12')
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,43 @@
1
+ require 'spec_helper'
2
+
3
+ describe "@include omega()" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("omega")
6
+ end
7
+
8
+ context "with no argument" do
9
+ it "removes right margin" do
10
+ expect('.omega-default').to have_rule('margin-right: 0')
11
+ end
12
+ end
13
+
14
+ context "with argument (4n)" do
15
+ it "removes right margin of nth-child(4n)" do
16
+ expect('.omega-nth-default:nth-child(4n)').to have_rule('margin-right: 0')
17
+ end
18
+
19
+ it "adds clear to nth-child(4n+1)" do
20
+ expect('.omega-nth-default:nth-child(4n+1)').to have_rule('clear: left')
21
+ end
22
+ end
23
+
24
+ context "with argument ('4n+1')" do
25
+ it "removes right margin of nth-child(4n+1)" do
26
+ expect('.omega-complex-nth:nth-child(4n+1)').to have_rule('margin-right: 0')
27
+ end
28
+ end
29
+
30
+ context "when called inside an RTL row" do
31
+ context "with no argument" do
32
+ it "removes left margin" do
33
+ expect('section .omega-default-left').to have_rule('margin-left: 0')
34
+ end
35
+ end
36
+
37
+ context "with argument (4n block)" do
38
+ it "removes left margin of nth-child(4n)" do
39
+ expect('section .omega-nth-default-left:nth-child(4n)').to have_rule('margin-left: 0')
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,32 @@
1
+ require 'spec_helper'
2
+
3
+ describe "@include pad()" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("pad")
6
+ end
7
+
8
+ context "with no argument" do
9
+ it "sets padding to gutter percentage" do
10
+ expect('.pad-default').to have_rule('padding: 2.35765%')
11
+ end
12
+ end
13
+
14
+ context "with argument (20px)" do
15
+ it "sets padding to 20px" do
16
+ expect('.pad-explicit').to have_rule('padding: 20px')
17
+ end
18
+ end
19
+
20
+ context "with argument (30px 20px 10px 5px)" do
21
+ it "sets padding to 30px 20px 10px 5px" do
22
+ expect('.pad-shorthand').to have_rule('padding: 30px 20px 10px 5px')
23
+ end
24
+ end
25
+
26
+ context "with argument (default)" do
27
+ it "uses default gutter percentage" do
28
+ expect('.pad-shorthand-default').to have_rule('padding: 30px 2.35765% 10px 2.35765%')
29
+ end
30
+ end
31
+ end
32
+
@@ -0,0 +1,39 @@
1
+ require 'spec_helper'
2
+
3
+ describe "@include row()" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("row")
6
+ end
7
+
8
+ context "with no argument" do
9
+ it "adds clearfix" do
10
+ expect('.row-default:after').to have_rule('clear: both')
11
+ end
12
+
13
+ it "sets display to block" do
14
+ expect('.row-default').to have_rule('display: block')
15
+ end
16
+ end
17
+
18
+ context "with argument (table)" do
19
+ it "sets display to table" do
20
+ expect('.row-table').to have_rule('display: table')
21
+ end
22
+
23
+ it "forces table-cell display on child elements" do
24
+ expect('.row-table-reset .block-child').to have_rule('display: table-cell')
25
+ end
26
+ end
27
+
28
+ context "with reset-display()" do
29
+ it "resets display to block" do
30
+ expect('.no-row').to have_rule('display: block')
31
+ end
32
+ end
33
+
34
+ context "with invalid display argument" do
35
+ it "sets display to block" do
36
+ expect('.row-invalid-display').to have_rule('display: block')
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,41 @@
1
+ require 'spec_helper'
2
+
3
+ describe "@include shift()" do
4
+ before(:all) do
5
+ ParserSupport.parse_file("shift")
6
+ end
7
+
8
+ context "with no argument" do
9
+ it "shifts element one column in the default direction" do
10
+ expect('.shift-default').to have_rule('margin-left: 8.5298%')
11
+ end
12
+ end
13
+
14
+ context "with argument (2)" do
15
+ it "shifts element 2 columns in the default direction" do
16
+ expect('.shift-positive').to have_rule('margin-left: 17.05961%')
17
+ end
18
+ end
19
+
20
+ context "with argument (-3)" do
21
+ it "shifts element 3 columns in the opposite direction" do
22
+ expect('.shift-negative').to have_rule('margin-left: -25.58941%')
23
+ end
24
+ end
25
+
26
+ context "when nested" do
27
+ it "shifts element relative to its parent" do
28
+ expect('.shifted-parent .shifted-child').to have_rule('margin-left: 34.94305%')
29
+ end
30
+
31
+ it "resets nesting context" do
32
+ expect('.post-nested-shift').to have_rule('margin-left: 17.05961%')
33
+ end
34
+ end
35
+
36
+ context "when layout direction changes" do
37
+ it "shifts element in the corresponding direction" do
38
+ expect('section .shift-negative').to have_rule('margin-right: -25.58941%')
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,25 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+ require 'rspec'
4
+ require 'poxy'
5
+ require 'aruba/api'
6
+ require 'css_parser'
7
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
8
+
9
+ RSpec.configure do |config|
10
+ config.include BourbonSupport
11
+ config.include SassSupport
12
+ config.include CssParser
13
+ config.include ParserSupport
14
+ config.include Aruba::Api
15
+
16
+ config.before(:all) do
17
+ install_bourbon_files
18
+ generate_css
19
+ end
20
+
21
+ config.after(:all) do
22
+ remove_bourbon_files
23
+ clean_up
24
+ end
25
+ end
@@ -0,0 +1,9 @@
1
+ module BourbonSupport
2
+ def install_bourbon_files
3
+ `bourbon install --path test`
4
+ end
5
+
6
+ def remove_bourbon_files
7
+ FileUtils.rm_rf('test/bourbon')
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ RSpec::Matchers.define :be_contained_in do |expected|
2
+ match do |actual|
3
+ @query = ParserSupport.parser.find_by_selector(actual, expected)
4
+ @query.any?
5
+ end
6
+
7
+ failure_message_for_should do |actual|
8
+ %{expected selector #{actual} to be contained in #{expected}}
9
+ end
10
+ end
@@ -0,0 +1,33 @@
1
+ RSpec::Matchers.define :have_rule do |expected|
2
+ match do |actual|
3
+ @rules = rules_from_selector(actual)
4
+ @rules.include? expected
5
+ end
6
+
7
+ failure_message_for_should do |actual|
8
+ if @rules.empty?
9
+ %{no CSS rules for selector #{actual} were found}
10
+ else
11
+ %{expected selector #{actual} to have CSS rule "#{expected}"}
12
+ end
13
+ end
14
+
15
+ def rules_from_selector(selector)
16
+ rulesets = ParserSupport.parser.find_by_selector(selector)
17
+ if rulesets.empty?
18
+ []
19
+ else
20
+ rules(rulesets)
21
+ end
22
+ end
23
+
24
+ def rules(rulesets)
25
+ rules = []
26
+ rulesets.map do |ruleset|
27
+ ruleset.split(';').each do |rule|
28
+ rules << rule.strip
29
+ end
30
+ end
31
+ rules
32
+ end
33
+ end
@@ -0,0 +1,15 @@
1
+ RSpec::Matchers.define :have_value do |expected|
2
+ match do |actual|
3
+ selector_id = actual.sub('$','#')
4
+ value_attribute = ParserSupport.parser.find_by_selector(selector_id)[0]
5
+
6
+ unless value_attribute.nil?
7
+ actual_value = value_attribute.split(':')[1].strip.sub(';', '')
8
+ actual_value == expected
9
+ end
10
+ end
11
+
12
+ failure_message_for_should do |actual|
13
+ %{expected variable #{actual} to have value "#{expected}"}
14
+ end
15
+ end
@@ -0,0 +1,9 @@
1
+ module ParserSupport
2
+ def self.parser
3
+ @parser ||= CssParser::Parser.new
4
+ end
5
+
6
+ def self.parse_file(identifier)
7
+ self.parser.load_file!("tmp/#{identifier}.css")
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ module SassSupport
2
+ def generate_css
3
+ _mkdir('tmp')
4
+ `sass -I . --update test:tmp`
5
+ end
6
+
7
+ def clean_up
8
+ FileUtils.rm_rf('tmp')
9
+ end
10
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Wood
@@ -38,6 +38,34 @@ dependencies:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: aruba
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 0.5.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.5.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
41
69
  - !ruby/object:Gem::Dependency
42
70
  name: css_parser
43
71
  requirement: !ruby/object:Gem::Requirement
@@ -53,21 +81,35 @@ dependencies:
53
81
  - !ruby/object:Gem::Version
54
82
  version: '0'
55
83
  - !ruby/object:Gem::Dependency
56
- name: bundler
84
+ name: rspec
57
85
  requirement: !ruby/object:Gem::Requirement
58
86
  requirements:
59
- - - ~>
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
60
95
  - !ruby/object:Gem::Version
61
- version: '1.3'
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rdoc
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
62
104
  type: :development
63
105
  prerelease: false
64
106
  version_requirements: !ruby/object:Gem::Requirement
65
107
  requirements:
66
- - - ~>
108
+ - - '>='
67
109
  - !ruby/object:Gem::Version
68
- version: '1.3'
110
+ version: '0'
69
111
  - !ruby/object:Gem::Dependency
70
- name: rake
112
+ name: bundler
71
113
  requirement: !ruby/object:Gem::Requirement
72
114
  requirements:
73
115
  - - '>='
@@ -80,22 +122,61 @@ dependencies:
80
122
  - - '>='
81
123
  - !ruby/object:Gem::Version
82
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rb-fsevent
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ~>
130
+ - !ruby/object:Gem::Version
131
+ version: 0.9.1
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ~>
137
+ - !ruby/object:Gem::Version
138
+ version: 0.9.1
83
139
  description: A responsive fixed width grid framework built on top of Sass based on
84
140
  the Frameless Grid by Joni Korpi
85
141
  email:
86
142
  - paulwooddesign@gmail.com
87
- executables: []
143
+ executables:
144
+ - poxy
88
145
  extensions: []
89
146
  extra_rdoc_files: []
90
147
  files:
91
148
  - .gitignore
149
+ - .rspec
150
+ - CONTRIBUTING.md
92
151
  - Gemfile
93
- - LICENSE.txt
152
+ - LICENSE
153
+ - NEWS.md
94
154
  - README.md
95
155
  - Rakefile
156
+ - app/assets/stylesheets/_poxy.scss
157
+ - bin/poxy
158
+ - bower.json
96
159
  - lib/poxy.rb
160
+ - lib/poxy/engine.rb
161
+ - lib/poxy/generator.rb
97
162
  - lib/poxy/version.rb
163
+ - lib/tasks/install.rake
98
164
  - poxy.gemspec
165
+ - spec/poxy/columns_spec.rb
166
+ - spec/poxy/container_spec.rb
167
+ - spec/poxy/media_spec.rb
168
+ - spec/poxy/new_breakpoint_spec.rb
169
+ - spec/poxy/omega_spec.rb
170
+ - spec/poxy/pad_spec.rb
171
+ - spec/poxy/row_spec.rb
172
+ - spec/poxy/shift_spec.rb
173
+ - spec/spec_helper.rb
174
+ - spec/support/bourbon_support.rb
175
+ - spec/support/matchers/be_contained_in.rb
176
+ - spec/support/matchers/have_rule.rb
177
+ - spec/support/matchers/have_value.rb
178
+ - spec/support/parser_support.rb
179
+ - spec/support/sass_support.rb
99
180
  homepage: https://github.com/paulwooddesign/poxy
100
181
  licenses:
101
182
  - MIT
@@ -115,10 +196,25 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
196
  - !ruby/object:Gem::Version
116
197
  version: '0'
117
198
  requirements: []
118
- rubyforge_project:
199
+ rubyforge_project: poxy
119
200
  rubygems_version: 2.0.3
120
201
  signing_key:
121
202
  specification_version: 4
122
203
  summary: A responsive fixed width grid framework built on top of Sass based on the
123
204
  Frameless Grid by Joni Korpi
124
- test_files: []
205
+ test_files:
206
+ - spec/poxy/columns_spec.rb
207
+ - spec/poxy/container_spec.rb
208
+ - spec/poxy/media_spec.rb
209
+ - spec/poxy/new_breakpoint_spec.rb
210
+ - spec/poxy/omega_spec.rb
211
+ - spec/poxy/pad_spec.rb
212
+ - spec/poxy/row_spec.rb
213
+ - spec/poxy/shift_spec.rb
214
+ - spec/spec_helper.rb
215
+ - spec/support/bourbon_support.rb
216
+ - spec/support/matchers/be_contained_in.rb
217
+ - spec/support/matchers/have_rule.rb
218
+ - spec/support/matchers/have_value.rb
219
+ - spec/support/parser_support.rb
220
+ - spec/support/sass_support.rb
data/LICENSE.txt DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) 2014 Paul Wood
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.