cactu 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec49ffcf115bc23f82c7af823b8c6645c28874e2
4
- data.tar.gz: 32510a6cd1a6a468d28c459e3d4279ad6fd2f1f2
3
+ metadata.gz: e9231f46985d560aa745cd2e7cd5c9b6c30487e6
4
+ data.tar.gz: 7c2b2872a6ad9070154a84634f7db766388b399a
5
5
  SHA512:
6
- metadata.gz: 4e92ca75f1b41f0a137ff6347d5b10776bba073e59029b668297b30a5da1e51bf9535300b58d7e7c57db90969c40abf639eec0334d3ae72a970ab774d57b34bb
7
- data.tar.gz: a9cd69310d5d216b79fb8b60300890ecd911cb8d0d6193c416888e4f311eaaa09afdc6a84a8042529edffb4cad3a57ecbdb7c3253be9db689de9e29df7946d18
6
+ metadata.gz: 6a5edf9ebb7a2e48d8033ec4b609233020118e326cc8690c43b3e942d58c8233c000c524ae44e3b1a8ded64b6c7a4c9215e9fb3ebbdc899ac47266b4dca25007
7
+ data.tar.gz: 10a75614203171af3c9c337e43365261144158989bbffd488e50f85336d6e3fe432d10fb5842af32ba0ce26a16e6cc4b8cf1e490f623c94edec4bc03860c18b3
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Cactu
2
2
 
3
- TODO: Write a gem description
3
+ ### A CSS library to help us to create webs easily
4
+
5
+ Cactu is a CSS library created to help any developer to create web pages
6
+ very quickly and an easy way
4
7
 
5
8
  ## Installation
6
9
 
@@ -18,7 +21,17 @@ Or install it yourself as:
18
21
 
19
22
  ## Usage
20
23
 
21
- TODO: Write usage instructions here
24
+ Rename you `application.css` file to `application.css.scss`:
25
+
26
+ mv app/assets/stylesheets/application.css app/assets/stylesheets/application.css.scss
27
+
28
+ Delete the sprocket directive in `application.css.scss`:
29
+
30
+ *= require_tree .
31
+
32
+ Import Cactu to `application.css.scss` file:
33
+
34
+ @import 'cactu';
22
35
 
23
36
  ## Contributing
24
37
 
@@ -0,0 +1,8 @@
1
+ @import 'functions/grid';
2
+
3
+ @import 'config/variables';
4
+
5
+ @import 'mixins/grid';
6
+ @import 'mixins/fonts';
7
+
8
+ @import 'ui/base';
@@ -0,0 +1,7 @@
1
+ //
2
+ // CONFIG/VARIABLES
3
+ // --------------------------------------------------
4
+
5
+ // Colors
6
+ $green: #6bb130;
7
+ $yellow: #e9b70b;
@@ -0,0 +1,32 @@
1
+ //
2
+ // FUNCTIONS/GRID
3
+ // --------------------------------------------------
4
+
5
+
6
+ @function width_column($num, $size, $gutter) {
7
+ @return ($num * $size) + (($num - 1) * $gutter);
8
+ }
9
+
10
+ @function grid_size($column, $gutter, $max_cols) {
11
+ @return ($column * $max_cols) + ($gutter * $max_cols);
12
+ }
13
+
14
+ @function fluid_width_column($num, $size, $gutter, $max_cols: 12) {
15
+ $col_width: width_column($num, $size, $gutter);
16
+ $sizer: grid_size($size, $gutter, $max_cols);
17
+
18
+ @return percentage($col_width / $sizer);
19
+ }
20
+
21
+ @function gutter_columns($column, $gutter, $max_cols) {
22
+ @return percentage(($gutter / 2) / grid_size($column, $gutter, $max_cols));
23
+ }
24
+
25
+ @function numbers($number) {
26
+ $n: "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven",
27
+ "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen",
28
+ "twenty", "twenty-one", "twenty-two", "twenty-three", "twenty-four", "twenty-five", "twenty-six", "twenty-seven",
29
+ "twenty-eight", "twenty-nine", "thirty", "thirty-one", "thirty-two", "thirty-three",
30
+ "thirty-four", "thirty-five", "thirty-six", "thirty-seven", "thirty-eight", "thirty-nine", "forty";
31
+ @return nth($n, $number);
32
+ }
@@ -0,0 +1,13 @@
1
+ //
2
+ // MIXINS/FONTS
3
+ // --------------------------------------------------
4
+
5
+
6
+ @mixin font_face($font, $url) {
7
+ @font-face {
8
+ font-family: $font;
9
+ src: url("../#{$url}.otf"),
10
+ url("../#{$url}.eot"),
11
+ url("../#{$url}.ttf");
12
+ }
13
+ }
@@ -0,0 +1,80 @@
1
+ //
2
+ // MIXINS/GRID
3
+ // --------------------------------------------------
4
+
5
+
6
+ @mixin grid_generator($size_col: 0, $gutter: 0, $max_cols: 12) {
7
+ @if $size_col == 0 and $gutter == 0 {
8
+ .row {
9
+ margin: 0 5%;
10
+ width: 90%;
11
+ }
12
+
13
+ [class *= "-column"] {
14
+ overflow: hidden;
15
+ float: left;
16
+ margin: 0;
17
+ width: 100%;
18
+ }
19
+ }
20
+
21
+ @else if ($size_col + $gutter) < 61 {
22
+ .row {
23
+ width: grid_size($size_col, $gutter, $max_cols);
24
+ }
25
+
26
+ [class *= "-column"] {
27
+ overflow: hidden;
28
+ float: left;
29
+ margin: 0 gutter_columns($size_col, $gutter, $max_cols);
30
+ }
31
+
32
+ @for $i from 1 through $max_cols {
33
+ $col_width: width_column($i, $size_col, $gutter);
34
+ $sizer: grid_size($size_col, $gutter, $max_cols);
35
+ .#{numbers($i)}-columns { width: percentage($col_width / $sizer); }
36
+ }
37
+ }
38
+
39
+ @else {
40
+ .row {
41
+ width: grid_size($size_col, $gutter, $max_cols);
42
+ }
43
+
44
+ [class *= "-column"] {
45
+ overflow: hidden;
46
+ float: left;
47
+ margin: 0 gutter_columns($size_col, $gutter, $max_cols);
48
+ }
49
+
50
+ @for $i from 1 through $max_cols {
51
+ $col_width: width_column($i, $size_col, $gutter);
52
+ $sizer: grid_size($size_col, $gutter, $max_cols);
53
+ @if $i == 1 {
54
+ .one-column { width: percentage($col_width / $sizer); }
55
+ } @else {
56
+ .#{numbers($i)}-columns { width: percentage($col_width / $sizer); }
57
+ }
58
+ }
59
+ }
60
+ }
61
+
62
+ @mixin grid_offset($size_col, $gutter) {
63
+ @for $i from 1 through $max_cols - 1 {
64
+ $offset: ($i * $size) + ($i * $gutter) + ($gutter / 2);
65
+ $sizer: grid_size($size_col, $gutter, $max_cols);
66
+ .offset-#{numbers($i)} { margin-left: percentage($offset / $sizer); }
67
+ }
68
+ }
69
+
70
+ @mixin grid_centered($size_col: 0, $gutter: 0) {
71
+ @for $i from 1 through $max_cols - 1 {
72
+ $col_width: width_column($i, $size_col, $gutter);
73
+ $sizer: grid_size($size_col, $gutter, $max_cols);
74
+ $marger: ($sizer - $col_width) / 2;
75
+ .centered-#{numbers($i)} {
76
+ //margin_lr: percentage($marger / $sizer);
77
+ margin: 0 percentage($marger / $sizer);
78
+ }
79
+ }
80
+ }
@@ -0,0 +1,69 @@
1
+ //
2
+ // UI/BASE
3
+ // --------------------------------------------------
4
+
5
+ * {
6
+ margin: 0;
7
+ padding: 0;
8
+ border: 0;
9
+ font-size: 100%;
10
+ }
11
+
12
+ html, body {
13
+ width: 100%;
14
+ height: 100%;
15
+ line-height: 1.250em;
16
+ font-family: Helvetica, Arial, sans-serif;
17
+ font-size: 14px;
18
+ line-height: 20px;
19
+ color: #333333;
20
+ background-color: #ffffff;
21
+ }
22
+
23
+ article,
24
+ aside,
25
+ details,
26
+ div,
27
+ figcaption,
28
+ figure,
29
+ footer,
30
+ header,
31
+ hgroup,
32
+ nav,
33
+ section {
34
+ display: block;
35
+ }
36
+
37
+ audio,
38
+ canvas,
39
+ video {
40
+ display: inline-block;
41
+ }
42
+
43
+ audio:not([controls]) {
44
+ display: none;
45
+ }
46
+
47
+ .container, .row {
48
+ overflow: hidden;
49
+ margin: 0 auto;
50
+ width: 100%;
51
+ }
52
+
53
+ [class *="centered"] {
54
+ text-align: center;
55
+ }
56
+
57
+ // Fonts
58
+ .hide-text {
59
+ background-color: transparent;
60
+ border: 0;
61
+ font: 0/0 a;
62
+ color: transparent;
63
+ text-shadow: none;
64
+ }
65
+
66
+ // Anchors
67
+ a {
68
+ text-decoration: none;
69
+ }
@@ -0,0 +1,3 @@
1
+ //
2
+ // UI/BUTTONS
3
+ // --------------------------------------------------
@@ -0,0 +1,3 @@
1
+ //
2
+ // UI/FORMS
3
+ // --------------------------------------------------
@@ -0,0 +1,3 @@
1
+ //
2
+ // UI/IMAGES
3
+ // --------------------------------------------------
@@ -0,0 +1,3 @@
1
+ //
2
+ // UI/MENUS
3
+ // --------------------------------------------------
@@ -0,0 +1,3 @@
1
+ //
2
+ // UI/TABLES
3
+ // --------------------------------------------------
@@ -0,0 +1,3 @@
1
+ //
2
+ // UI/TEXT
3
+ // --------------------------------------------------
data/bin/cactu ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # CodeKit needs relative paths
4
+ require File.dirname(__FILE__) + '/../lib/cactu.rb'
5
+
6
+ Cactu::Generator.start
data/cactu.gemspec CHANGED
@@ -1,6 +1,5 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
2
+ $:.push File.expand_path("../lib", __FILE__)
4
3
  require 'cactu/version'
5
4
 
6
5
  Gem::Specification.new do |spec|
@@ -11,19 +10,17 @@ Gem::Specification.new do |spec|
11
10
  spec.email = ["mendozagioo@gmail.com"]
12
11
  spec.summary = "Cactu is a CSS library to help us to create webs easily"
13
12
  spec.description = "Cactu is a CSS library created to help any developer to create web pages very quickly and an easy way"
14
- spec.homepage = "http://cactu.herokuapp.com"
13
+ spec.homepage = "https://github.com/mendozagioo/cactu"
15
14
  spec.license = "MIT"
16
15
 
17
16
  spec.rubyforge_project = "cactu"
18
17
 
19
- spec.files = `git ls-files`.split($/)
20
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
21
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.files = `git ls-files`.split("\n")
19
+ spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
20
  spec.require_paths = ["lib"]
23
21
 
24
22
  spec.add_dependency('sass', '>= 3.2.0')
25
23
  spec.add_dependency('thor')
26
24
 
27
- spec.add_development_dependency "bundler", "~> 1.3"
28
25
  spec.add_development_dependency "rake"
29
26
  end
@@ -0,0 +1,5 @@
1
+ module Cactu
2
+ class Engine < Rails::Engine
3
+ # auto wire
4
+ end
5
+ end
@@ -0,0 +1,80 @@
1
+ require 'cactu/version'
2
+ require "fileutils"
3
+ require 'thor'
4
+
5
+ module Cactu
6
+ class Generator < Thor
7
+ map ['-v', '--version'] => :version
8
+
9
+ desc 'install', 'Install Cactu into your project'
10
+ method_options :path => :string, :force => :boolean
11
+ def install
12
+ if cactu_files_already_exist? && !options[:force]
13
+ puts "Cactu files already installed, doing nothing."
14
+ else
15
+ install_files
16
+ puts "Cactu files installed to #{install_path}/"
17
+ end
18
+ end
19
+
20
+ desc 'update', 'Update Cactu'
21
+ method_options :path => :string
22
+ def update
23
+ if cactu_files_already_exist?
24
+ remove_cactu_directory
25
+ install_files
26
+ puts "Cactu files updated."
27
+ else
28
+ puts "No existing cactu installation. Doing nothing."
29
+ end
30
+ end
31
+
32
+ desc 'version', 'Show Cactu version'
33
+ def version
34
+ say "Cactu #{Cactu::VERSION}"
35
+ end
36
+
37
+ private
38
+
39
+ def cactu_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], 'cactu'))
46
+ else
47
+ Pathname.new('cactu')
48
+ end
49
+ end
50
+
51
+ def install_files
52
+ make_install_directory
53
+ copy_in_scss_files
54
+ end
55
+
56
+ def remove_cactu_directory
57
+ FileUtils.rm_rf("cactu")
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
data/lib/cactu/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cactu
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cactu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Mendoza
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-14 00:00:00.000000000 Z
11
+ date: 2013-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: bundler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ~>
46
- - !ruby/object:Gem::Version
47
- version: '1.3'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ~>
53
- - !ruby/object:Gem::Version
54
- version: '1.3'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: rake
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -70,7 +56,8 @@ description: Cactu is a CSS library created to help any developer to create web
70
56
  very quickly and an easy way
71
57
  email:
72
58
  - mendozagioo@gmail.com
73
- executables: []
59
+ executables:
60
+ - cactu
74
61
  extensions: []
75
62
  extra_rdoc_files: []
76
63
  files:
@@ -79,10 +66,25 @@ files:
79
66
  - LICENSE.txt
80
67
  - README.md
81
68
  - Rakefile
69
+ - app/assets/stylesheets/_cactu.scss
70
+ - app/assets/stylesheets/config/_variables.scss
71
+ - app/assets/stylesheets/functions/_grid.scss
72
+ - app/assets/stylesheets/mixins/_fonts.scss
73
+ - app/assets/stylesheets/mixins/_grid.scss
74
+ - app/assets/stylesheets/ui/_base.scss
75
+ - app/assets/stylesheets/ui/_buttons.scss
76
+ - app/assets/stylesheets/ui/_forms.scss
77
+ - app/assets/stylesheets/ui/_images.scss
78
+ - app/assets/stylesheets/ui/_menus.scss
79
+ - app/assets/stylesheets/ui/_tables.scss
80
+ - app/assets/stylesheets/ui/_text.scss
81
+ - bin/cactu
82
82
  - cactu.gemspec
83
83
  - lib/cactu.rb
84
+ - lib/cactu/engine.rb
85
+ - lib/cactu/generator.rb
84
86
  - lib/cactu/version.rb
85
- homepage: http://cactu.herokuapp.com
87
+ homepage: https://github.com/mendozagioo/cactu
86
88
  licenses:
87
89
  - MIT
88
90
  metadata: {}
@@ -102,8 +104,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
104
  version: '0'
103
105
  requirements: []
104
106
  rubyforge_project: cactu
105
- rubygems_version: 2.0.5
107
+ rubygems_version: 2.0.2
106
108
  signing_key:
107
109
  specification_version: 4
108
110
  summary: Cactu is a CSS library to help us to create webs easily
109
111
  test_files: []
112
+ has_rdoc: