Permalink
Browse files

convert the gem to rubygem-tasks structure + use rdoc and rspec

  • Loading branch information...
1 parent 7f16d3c commit 63a7f47e46fe37702d02eb6a1c2afb57ec19f8f3 @thomaspierson committed Feb 2, 2013
Showing with 120 additions and 29 deletions.
  1. +4 −0 .document
  2. +2 −0 .gitignore
  3. +1 −0 .rspec
  4. +9 −0 ChangeLog.rdoc
  5. +0 −16 README.md
  6. +26 −0 README.rdoc
  7. +41 −0 Rakefile
  8. +21 −13 css2less.gemspec
  9. +3 −0 lib/css2less/version.rb
  10. +8 −0 spec/css2less_spec.rb
  11. +5 −0 spec/spec_helper.rb
View
@@ -0,0 +1,4 @@
+lib/**/*.rb
+README.rdoc
+ChangeLog.rdoc
+COPYING
View
@@ -1,3 +1,5 @@
*.css
*~
.project
+/html/
+/pkg/
View
1 .rspec
@@ -0,0 +1 @@
+--colour --format documentation
View
@@ -0,0 +1,9 @@
+=== 0.0.1 / 2013-02-02
+
+* Reformat the source code using Ruby conventions.
+* Convert Gem to rubygem-task format and use Rspec an Rdoc.
+
+=== 0.0.0 / 2012-04-23
+
+* Initial release: Refactor the script initially written by Marcin Kulik into a RubyGem library.
+
View
@@ -1,16 +0,0 @@
-Css2Less Library
-================
-
-A ruby library which convert old CSS stylesheet into LESS dynamic stylesheet.
-
-Based on css2less script initially written by Marcin Kulik.
-
-Refactored and Gemified by Thomas Pierson.
-
-## Simple usage ##
-
- cd monprojet/
-
- css2less myfile.css >> myfile.less
-
-That's all folks !
View
@@ -0,0 +1,26 @@
+= Css2Less
+
+* {Homepage}[https://github.com/thomaspierson/libcss2less]
+* {Documentation}[http://rubydoc.info/gems/css2less/frames]
+* {Email}[mailto:contact@thomaspierson.fr]
+
+== Description
+
+A ruby library which convert old CSS stylesheet into LESS dynamic stylesheet.
+Based on css2less script initially written by Marcin Kulik.
+Refactored and Gemified by Thomas Pierson.
+
+== Simple usage
+
+ css2less myfile.css > myfile.less
+
+== Install
+
+ $ gem install css2less
+
+== Copyright
+
+See COPYING for details.
+
+
+That's all folks !
View
@@ -0,0 +1,41 @@
+# encoding: utf-8
+
+require 'rubygems'
+require 'rake'
+
+begin
+ gem 'rubygems-tasks', '~> 0.2'
+ require 'rubygems/tasks'
+
+ Gem::Tasks.new
+rescue LoadError => e
+ warn e.message
+ warn "Run `gem install rubygems-tasks` to install Gem::Tasks."
+end
+
+begin
+ gem 'rdoc', '~> 3.0'
+ require 'rdoc/task'
+
+ RDoc::Task.new do |rdoc|
+ rdoc.title = "css2less"
+ end
+rescue LoadError => e
+ warn e.message
+ warn "Run `gem install rdoc` to install 'rdoc/task'."
+end
+task :doc => :rdoc
+
+begin
+ gem 'rspec', '~> 2.4'
+ require 'rspec/core/rake_task'
+
+ RSpec::Core::RakeTask.new
+rescue LoadError => e
+ task :spec do
+ abort "Please run `gem install rspec` to install RSpec."
+ end
+end
+
+task :test => :spec
+task :default => :spec
View
@@ -1,14 +1,22 @@
-Gem::Specification.new do |s|
- s.name = 'css2less'
- s.version = '0.0.0'
- s.date = '2012-04-23'
- s.summary = "CSS to LESS converter"
- s.description = "A ruby library which convert old CSS stylesheet into LESS dynamic stylesheet."
- s.authors = ['Thomas Pierson', 'Marcin Kulik']
- s.email = ['contact@thomaspierson.fr', 'm@ku1ik.com']
- s.license = 'GPL-3'
- s.files = ["lib/css2less.rb"]
- s.homepage =
- 'https://github.com/thomaspierson/libcss2less'
- s.executables << 'css2less'
+require File.expand_path('../lib/css2less/version', __FILE__)
+
+Gem::Specification.new do |gem|
+ gem.name = "css2less"
+ gem.version = Css2Less::VERSION
+ gem.summary = "CSS to LESS converter"
+ gem.description = "A ruby library which convert old CSS stylesheet into LESS dynamic stylesheet."
+ gem.license = "GPL-3"
+ gem.authors = ["Thomas Pierson", "Marcin Kulik"]
+ gem.email = ["contact@thomaspierson.fr", "m@ku1ik.com"]
+ gem.homepage = "https://github.com/thomaspierson/libcss2less"
+
+ gem.files = `git ls-files`.split($/)
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
+ gem.require_paths = ['lib']
+
+ gem.add_development_dependency 'rdoc', '~> 3.0'
+ gem.add_development_dependency 'rspec', '~> 2.4'
+ gem.add_development_dependency 'rubygems-tasks', '~> 0.2'
end
+
View
@@ -0,0 +1,3 @@
+module Css2Less
+ VERSION = "0.0.1"
+end
View
@@ -0,0 +1,8 @@
+require 'spec_helper'
+require 'css2less'
+
+describe Css2Less do
+ it "should have a VERSION constant" do
+ subject.const_get('VERSION').should_not be_empty
+ end
+end
View
@@ -0,0 +1,5 @@
+gem 'rspec', '~> 2.4'
+require 'rspec'
+require 'css2less/version'
+
+include Css2Less

0 comments on commit 63a7f47

Please sign in to comment.