poxy 0.0.0

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3d3de3977f530186101ce15a93ca8a86ba91f7dc
4
+ data.tar.gz: 5eb5ebc9e9b47fac83b94cf514a3404aae549183
5
+ SHA512:
6
+ metadata.gz: ef48d82a6b8a1960e352165d40a44c4fce7d3ef7d9d225c42d115d4afd597ec73ef1e23bb69f2542dd258482ff5ab2a6609147a8b53bb7a5d03d0d943c780b98
7
+ data.tar.gz: 4c6f57bedbddfbbb4ae790546dff736025a2338b8d1535653976a719339117c6596ce7543d45c2358cb156351d4496a451bbda9dc48996f0274ccebf48c68e13
data/.gitignore ADDED
@@ -0,0 +1,15 @@
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
14
+ pkg
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 ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in poxy.gemspec
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/README.md ADDED
@@ -0,0 +1,7 @@
1
+ [![Poxy](http://poxy.io/wp-content/uploads/2014/04/poxy_logo.png)](http://poxy.io)
2
+
3
+
4
+ poxy
5
+ ====
6
+
7
+ Responsive fixed width grid framework built on top of Sass based on the Frameless Grid by Joni Korpi
data/Rakefile ADDED
@@ -0,0 +1,22 @@
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 1.0.0.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
+ Neat::Generator.new(ARGV).run
data/bower.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "poxy",
3
+ "version": "1.0.0",
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
+ }
data/lib/poxy.rb ADDED
@@ -0,0 +1,20 @@
1
+ require "bourbon"
2
+ require "poxy/generator"
3
+
4
+ module Poxy
5
+ if defined?(Rails) && defined?(Rails::Engine)
6
+ class Engine < ::Rails::Engine
7
+ require 'poxy/engine'
8
+ end
9
+
10
+ module Rails
11
+ class Railtie < ::Rails::Railtie
12
+ rake_tasks do
13
+ load "tasks/install.rake"
14
+ end
15
+ end
16
+ end
17
+ else
18
+ Sass.load_paths << File.expand_path("../../app/assets/stylesheets", __FILE__)
19
+ end
20
+ end
@@ -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
@@ -0,0 +1,3 @@
1
+ module Poxy
2
+ VERSION = '1.0.0'
3
+ 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 ADDED
@@ -0,0 +1,36 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path('../lib', __FILE__)
3
+ require 'poxy/version'
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'poxy'
7
+ #s.version = poxy::VERSION
8
+ s.version = '0.0.0'
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 = <<-DESC
16
+ poxy a responsive fixed width grid framework built on top of Sass based on the Frameless Grid by Joni Korpi.
17
+ DESC
18
+
19
+ s.rubyforge_project = 'poxy'
20
+
21
+ s.files = `git ls-files`.split("\n")
22
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
23
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
24
+ s.require_paths = ['lib']
25
+
26
+ s.add_dependency('sass', '>= 3.3')
27
+ s.add_dependency('bourbon', '>= 3.1')
28
+
29
+ s.add_development_dependency('aruba', '~> 0.5.0')
30
+ s.add_development_dependency('rake')
31
+ s.add_development_dependency('css_parser')
32
+ s.add_development_dependency('rspec')
33
+ s.add_development_dependency('rdoc')
34
+ s.add_development_dependency('bundler')
35
+ s.add_development_dependency('rb-fsevent', '~> 0.9.1')
36
+ 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 ADDED
@@ -0,0 +1,220 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: poxy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Paul Wood
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-11 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: bourbon
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '3.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
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'
69
+ - !ruby/object:Gem::Dependency
70
+ name: css_parser
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
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
+ - - '>='
95
+ - !ruby/object:Gem::Version
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'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: bundler
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
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
139
+ description: |
140
+ poxy a responsive fixed width grid framework built on top of Sass based on the Frameless Grid by Joni Korpi.
141
+ email:
142
+ - paulwooddesign@gmail.com
143
+ executables:
144
+ - poxy
145
+ extensions: []
146
+ extra_rdoc_files: []
147
+ files:
148
+ - .gitignore
149
+ - .rspec
150
+ - CONTRIBUTING.md
151
+ - Gemfile
152
+ - LICENSE
153
+ - NEWS.md
154
+ - README.md
155
+ - Rakefile
156
+ - app/assets/stylesheets/_poxy.scss
157
+ - bin/poxy
158
+ - bower.json
159
+ - lib/poxy.rb
160
+ - lib/poxy/engine.rb
161
+ - lib/poxy/generator.rb
162
+ - lib/poxy/version.rb
163
+ - lib/tasks/install.rake
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
180
+ homepage: https://github.com/paulwooddesign/poxy
181
+ licenses:
182
+ - MIT
183
+ metadata: {}
184
+ post_install_message:
185
+ rdoc_options: []
186
+ require_paths:
187
+ - lib
188
+ required_ruby_version: !ruby/object:Gem::Requirement
189
+ requirements:
190
+ - - '>='
191
+ - !ruby/object:Gem::Version
192
+ version: '0'
193
+ required_rubygems_version: !ruby/object:Gem::Requirement
194
+ requirements:
195
+ - - '>='
196
+ - !ruby/object:Gem::Version
197
+ version: '0'
198
+ requirements: []
199
+ rubyforge_project: poxy
200
+ rubygems_version: 2.0.3
201
+ signing_key:
202
+ specification_version: 4
203
+ summary: A responsive fixed width grid framework built on top of Sass based on the
204
+ Frameless Grid by Joni Korpi
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