Permalink
Browse files

updated gem generation to no longer use jewler

  • Loading branch information...
1 parent d5858f8 commit b0a89a7f0f94ce8cb7f5cd1c40893a47feafdfa9 @imathis committed Jan 22, 2011
Showing with 114 additions and 74 deletions.
  1. +2 −2 .gitignore
  2. +1 −1 .rvmrc
  3. +0 −1 Gemfile
  4. +2 −20 Rakefile
  5. +4 −3 VERSION.yml
  6. +17 −0 example/button-advanced.html
  7. +2 −2 example/config.rb
  8. +7 −0 example/src/button-advanced.scss
  9. +1 −1 example/src/buttons.sass
  10. +18 −44 fancy-buttons.gemspec
  11. +60 −0 lib/version.rb
View
4 .gitignore
@@ -1,5 +1,5 @@
src/.sass-cache/
example/stylesheets/
-example/src/.sass-cache
+example/sass/.sass-cache
*.gem
-.bundle
+.bundle
View
2 .rvmrc
@@ -1 +1 @@
-rvm 1.8.7@fancy-buttons
+rvm 1.8.7-p302@fancy-buttons
View
1 Gemfile
@@ -1,4 +1,3 @@
source "http://rubygems.org"
gem 'compass'
-gem 'jeweler'
View
22 Rakefile
@@ -1,20 +1,2 @@
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gemspec|
- gemspec.name = "fancy-buttons"
- gemspec.summary = "Make fancy buttons with the Compass stylesheet authoring framework."
- gemspec.description = "Easily style buttons with beautiful CSS3 features like gradients, rounded corners, etc. Don't worry the buttons also degrade nicely for browsers with no support. This requires the Compass stylesheet authoring framework."
- gemspec.email = "brandon@imathis.com"
- gemspec.homepage = "http://github.com/imathis/fancy-buttons"
- gemspec.author = "Brandon Mathis"
- gemspec.add_dependency('compass', '>= 0.10.6')
- gemspec.files = []
- gemspec.files << "fancy-buttons.gemspec"
- gemspec.files << "README.markdown"
- gemspec.files << "Rakefile"
- gemspec.files << "VERSION"
- gemspec.files += Dir.glob("lib/**/*")
- end
-rescue LoadError
- puts "Jeweler not available. Install it with: sudo gem install jeweler -s http://rubygems.org"
-end
+require 'rubygems'
+require 'rake'
View
7 VERSION.yml
@@ -1,5 +1,6 @@
----
-:patch: 5
-:build:
+---
:major: 1
:minor: 0
+:patch: 5
+:state:
+:build:
View
17 example/button-advanced.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+ <title>Fancy Buttons - Advanced Demo</title>
+ <link href="./stylesheets/button-advanced.css" media="screen, projection" rel="stylesheet" type="text/css" />
+ <!--[if lte IE 6]>
+ <link href='./stylesheets/ie6.css' rel='stylesheet' type='text/css' />
+ <![endif]-->
+</head>
+ <body>
+ <h1>Fancy Buttons</h1>
+ <div>
+ <button>Fancy!</button>
+ </div>
+ </body>
+</html>
View
4 example/config.rb
@@ -3,6 +3,6 @@
project_type = :stand_alone
css_dir = "stylesheets"
-sass_dir = "src"
+sass_dir = "sass"
images_dir = "images"
-relative_assets = true
+relative_assets = true
View
7 example/src/button-advanced.scss
@@ -0,0 +1,7 @@
+@import "page-styles";
+@import "fancy-buttons";
+
+button {
+ @include fancy-button-structure(26px, 1em, 4px);
+ @include fancy-button-colors(#124c89, adjust-hue(#124c89, -120), darken(adjust-hue(#124c89, -120), 6));
+ }
View
2 example/src/buttons.sass
@@ -22,7 +22,7 @@ $heart_button: saturate(lighten($red, 2), 20)
=custom-fancy-gradient($color1, $color2)
+radial-gradient(color_stops($color1, darken($color2, 5) 30px), "50% 10%")
-=invert-custom-fancy-gradient($color1, $color2)
+=custom-fancy-gradient-active($color1, $color2)
+custom-fancy-gradient(lighten($color2, 10), lighten($color2, 25))
.fancy-button-base
View
62 fancy-buttons.gemspec
@@ -1,49 +1,23 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
-# -*- encoding: utf-8 -*-
+path = "#{File.dirname(__FILE__)}/lib"
+require File.join(path, 'version')
-Gem::Specification.new do |s|
- s.name = %q{fancy-buttons}
- s.version = "1.0.3"
+Gem::Specification.new do |gemspec|
+ gemspec.name = "fancy-buttons"
+ gemspec.version = FancyButtons::VERSION # Update the VERSION.yml file to set this.
+ gemspec.date = "#{Time.now.year}-#{Time.now.month}-#{Time.now.day}" # Automatically update for each build
+ gemspec.description = "Fancy Buttons helps you easily style buttons with beautiful CSS3 features like gradients, rounded corners, etc. Don't worry the buttons also degrade nicely for browsers with no support. This requires the Compass stylesheet authoring framework."
+ gemspec.homepage = "http://github.com/imathis/fancy-buttons"
+ gemspec.authors = ["Brandon Mathis"]
+ gemspec.email = "brandon@imathis.com"
+ gemspec.has_rdoc = false
+ gemspec.require_paths = %w(lib)
+ gemspec.rubygems_version = "1.4.2"
+ gemspec.summary = "Make fancy CSS3 buttons with the Compass stylesheet authoring framework."
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Brandon Mathis"]
- s.date = %q{2010-10-30}
- s.description = %q{Easily style buttons with beautiful CSS3 features like gradients, rounded corners, etc. Don't worry the buttons also degrade nicely for browsers with no support. This requires the Compass stylesheet authoring framework.}
- s.email = %q{brandon@imathis.com}
- s.extra_rdoc_files = [
- "README.markdown"
- ]
- s.files = [
- "README.markdown",
- "Rakefile",
- "fancy-buttons.gemspec",
- "lib/fancy-buttons.rb",
- "lib/stylesheets/_fancy-buttons.sass",
- "lib/stylesheets/_fancy-gradient.sass",
- "lib/stylesheets/_fancy_buttons.sass",
- "lib/templates/project/button_bg.png",
- "lib/templates/project/ie6.sass",
- "lib/templates/project/manifest.rb"
- ]
- s.homepage = %q{http://github.com/imathis/fancy-buttons}
- s.rdoc_options = ["--charset=UTF-8"]
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.7}
- s.summary = %q{Make fancy buttons with the Compass stylesheet authoring framework.}
+ gemspec.add_dependency 'compass', '= 0.10.6'
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
-
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<compass>, [">= 0.10.6"])
- else
- s.add_dependency(%q<compass>, [">= 0.10.6"])
- end
- else
- s.add_dependency(%q<compass>, [">= 0.10.6"])
- end
+ gemspec.files = %w(README.markdown VERSION.yml Rakefile)
+ gemspec.files += Dir.glob("lib/**/*")
end
+
View
60 lib/version.rb
@@ -0,0 +1,60 @@
+module FancyButtons
+ module Version
+ # Returns a hash representing the version.
+ # The :major, :minor, and :teeny keys have their respective numbers.
+ # The :string key contains a human-readable string representation of the version.
+ # The :rev key will have the current revision hash.
+ #
+ # This method swiped from Compass by Chris Eppstein who swiped it from Haml and then modified it, so some credit goes to Nathan Weizenbaum too.
+ def version
+ if defined?(@version)
+ @version
+ else
+ read_version
+ end
+ end
+
+ protected
+
+ def scope(file) # :nodoc:
+ File.join(File.dirname(__FILE__), '..', file)
+ end
+
+ def read_version
+ require 'yaml'
+ @version = YAML::load(File.read(scope('VERSION.yml')))
+ @version[:teeny] = @version[:patch]
+ @version[:string] = "#{@version[:major]}.#{@version[:minor]}"
+ @version[:string] << ".#{@version[:patch]}" if @version[:patch]
+ @version[:string] << ".#{@version[:state]}" if @version[:state]
+ @version[:string] << ".#{@version[:build]}" if @version[:build]
+ #if !ENV['OFFICIAL'] && r = revision
+ # @version[:string] << ".#{r[0..6]}"
+ #end
+ @version
+ end
+
+ def revision
+ revision_from_git
+ end
+
+ def revision_from_git
+ if File.exists?(scope('.git/HEAD'))
+ rev = File.read(scope('.git/HEAD')).strip
+ if rev =~ /^ref: (.*)$/
+ rev = File.read(scope(".git/#{$1}")).strip
+ end
+ end
+ end
+ end
+ extend FancyButtons::Version
+ def self.const_missing(const)
+ # This avoid reading from disk unless the VERSION is requested.
+ if const == :VERSION
+ version[:string]
+ else
+ super
+ end
+ end
+end
+

0 comments on commit b0a89a7

Please sign in to comment.