Giter Club home page Giter Club logo

newgem's Introduction

New Gem Generator

DESCRIPTION:

Quickly bundle any Ruby libraries into a RubyGem and share it with the world, your colleagues, or perhaps just with yourself amongst your projects.

RubyGems are centrally stored, versioned, and support dependencies between other gems, so they are the ultimate way to bundle libraries, executables, associated tests, examples, and more.

Within this gem, you get one thing - newgem - an executable to create your own gems. Your new gems will include designated folders for Ruby code, test files, executables, and even a default website page for you to explain your project, and which instantly uploads to RubyForge website (which looks just like this one by default)

BASIC USAGE:

Go to the folder where you want to create your new gem folder structure, and run the newgem command to generate your gem scaffolding.

cd ~/ruby_projects
$ newgem wizzo
        create  
        create  doc
        create  lib
        create  script
        create  tasks
        create  lib/wizzo
        create  History.txt
        create  Rakefile
        create  README.rdoc
        create  PostInstall.txt
        create  lib/wizzo.rb
    dependency  install_test_unit
        create    test
        create    test/test_helper.rb
        create    test/test_wizzo.rb
    dependency  install_website
        create    website/javascripts
        create    website/stylesheets
        create    config
        exists    script
        exists    tasks
        create    website/index.txt
        create    website/index.html
        create    config/website.yml.sample
        create    script/txt2html
    dependency    plain_theme
        exists      website/javascripts
        exists      website/stylesheets
        create      website/template.html.erb
        create      website/stylesheets/screen.css
        create      website/javascripts/rounded_corners_lite.inc.js
    dependency  install_rubigen_scripts
        exists    script
        create    script/generate
        create    script/destroy
        create  script/console
        create  Manifest.txt
        readme  readme
  Important
  =========
  * Open Rakefile
  * Update missing details (gem description, dependent gems, etc.)

You can generate test::unit or rspec test stubs via the -T, –test-with options (shoulda coming soon)

SYNOPSIS:

Now modify the constants at the top of config/hoe.rb, with your name, email and the location where you’ll host your website for the gem. The defaults are tied to RubyForge for uploading the gems and the website.

REQUIREMENTS:

  • hoe

  • rubyforge

INSTALL:

The newgem application is distributed itself as a RubyGem and is available immediately after installation.

sudo gem install newgem

Alternately, download the gem and install manually.

TICKETS:

Tickets or suggestions can be raised at drnic.lighthouseapp.com/projects/18881-newgem/overview

DOES IT WORK?

Much of newgem’s behaviour is covered by functional tests (see features at github.com/drnic/newgem/tree/master/features).

With each commit to the master branch of the git repository, these functional tests and the unit tests are run via a continuous integration server.

Current build status: runcoderun.com/drnic/newgem

TUTORIALS:

LICENSE:

(The MIT License)

Copyright © 2006-2008 Dr Nic Williams

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

newgem's People

Contributors

aslakhellesoy avatar averyj avatar avh4 avatar bjeanes avatar drnic avatar misto avatar raggi avatar tapajos avatar wycats avatar ymendel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

newgem's Issues

RSpec2-support

the generated tasks/rspec.rake doesn't work with RSpec2

<CR> in files

There are (carriage returns) in several generated files (Rakefile, tests ...)

rake spec runs tests twice

newgem 1.5.3 / hoe 2.6.0:

When I create a new gem with -T rspec and I run rake spec, the tests run twice.
Removing tasks/rspec.rake solves this issue.

[Wishlist] RSpec+RCov Support

First, I'm a total Ruby/Rails/RSpec/rCov Newb, so be kind. :-)

I've been using newgem to create a new project every time I start working on a new code kata in Ruby. While there's a nice option for rspec support, I find myself always trying to run rake rcov, which does nothing for spec tests, then fumbling on the net to find a rake task.

Here's the rake task I usually find and apply. If would be nice if this was either generated when the rspec options were used, or there was another option to do so.

begin
  require 'rcov'
rescue LoadError
  require 'rubygems' unless ENV['NO_RUBYGEMS']
  require 'rcov'
end

"Run all specs with rcov and store coverage report in doc/output/coverage"
Spec::Rake::SpecTask.new(:spec_rcov) do |t|
  t.spec_files = FileList['spec/**/*.rb']
  t.rcov = true
  t.rcov_dir = 'doc/output/coverage'
  t.rcov_opts = ['-t --exclude', 'spec,\.autotest,rcov.rb']
end

warning: couldn't activate the cucumber_features plugin, skipping

  1. I create a project using newgem (log is below)
  2. run rake features and get the error:
    warning: couldn't activate the cucumber_features plugin, skipping

Google indicates "cucumber_features" is pretty specific to newgem :)
Appreciate any hits/tips.

newgem log

  exists  
  create  lib
  create  script
  create  lib/ffi-hdf
  create  History.txt
  create  Rakefile
  create  README.rdoc
  create  PostInstall.txt
  create  lib/ffi-hdf.rb

dependency install_rspec
create spec
create tasks
create spec/ffi-hdf_spec.rb
create spec/spec.opts
create spec/spec_helper.rb
create tasks/rspec.rake
dependency install_website
create website/javascripts
create website/stylesheets
create config
exists script
create website/index.txt
create website/index.html
create config/website.yml.sample
create script/txt2html
dependency plain_theme
exists website/javascripts
exists website/stylesheets
create website/template.html.erb
create website/stylesheets/screen.css
create website/javascripts/rounded_corners_lite.inc.js
dependency install_cucumber
create features/step_definitions
create features/support
create features/development.feature
create features/step_definitions/common_steps.rb
create features/support/env.rb
create features/support/common.rb
create features/support/matchers.rb
dependency install_rubigen_scripts
exists script
create script/generate
create script/destroy
create script/console
create Manifest.txt
readme readme

Important

  • Open Rakefile
  • Update missing details (gem description, dependent gems, etc.)

rubyforge RubyGem dependency is not declared in latest newgem release ...

e.g. I find the following after "gem install newgem":

➜ github newgem lilutils
/usr/local/rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/rubygems.rb:762:in report_activate_error': Could not find RubyGem rubyforge (>= 0) (Gem::LoadError) from /usr/local/rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/rubygems.rb:219:inactivate'
from /usr/local/rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/rubygems.rb:1065:in gem' from /usr/local/rvm/gems/ruby-1.9.2-p136@global/gems/newgem-1.5.3/lib/newgem/rubyforge-ext.rb:5:inrescue in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p136@global/gems/newgem-1.5.3/lib/newgem/rubyforge-ext.rb:1:in <top (required)>' from <internal:lib/rubygems/custom_require>:29:inrequire'
from internal:lib/rubygems/custom_require:29:in require' from /usr/local/rvm/gems/ruby-1.9.2-p136@global/gems/activesupport-2.3.10/lib/active_support/dependencies.rb:182:inblock in require'
from /usr/local/rvm/gems/ruby-1.9.2-p136@global/gems/activesupport-2.3.10/lib/active_support/dependencies.rb:547:in new_constants_in' from /usr/local/rvm/gems/ruby-1.9.2-p136@global/gems/activesupport-2.3.10/lib/active_support/dependencies.rb:182:inrequire'
from /usr/local/rvm/gems/ruby-1.9.2-p136@global/gems/newgem-1.5.3/app_generators/newgem/newgem_generator.rb:163:in extract_options' from /usr/local/rvm/gems/ruby-1.9.2-p136@global/gems/newgem-1.5.3/app_generators/newgem/newgem_generator.rb:38:ininitialize'
from /usr/local/rvm/gems/ruby-1.9.2-p136@global/gems/rubigen-1.5.5/lib/rubigen/lookup.rb:165:in new' from /usr/local/rvm/gems/ruby-1.9.2-p136@global/gems/rubigen-1.5.5/lib/rubigen/lookup.rb:165:ininstance'
from /usr/local/rvm/gems/ruby-1.9.2-p136@global/gems/rubigen-1.5.5/lib/rubigen/scripts.rb:32:in run' from /usr/local/rvm/gems/ruby-1.9.2-p136@global/gems/newgem-1.5.3/bin/newgem:28:in<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p136@global/bin/newgem:19:in load' from /usr/local/rvm/gems/ruby-1.9.2-p136@global/bin/newgem:19:in

'

Environment:

rvm:
version: "rvm 1.1.11 by Wayne E. Seguin ([email protected]) [http://rvm.beginrescueend.com/]"

ruby:
interpreter: "ruby"
version: "1.9.2p136"
date: "2010-12-25"
platform: "x86_64-linux"
patchlevel: "2010-12-25 revision 30365"
full_version: "ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux]"

Gem install displays 'PostInstall.txt' instead of contents

I'm guessing this isn't intended behavior, but when I install my gem, 'PostInstall.txt' is displayed instead of its contents.
Example: when i do 'gem install newgem' I get:

PostInstall.txt
Successfully installed newgem-1.5.3
1 gem installed
Installing ri documentation for newgem-1.5.3...
Installing RDoc documentation for newgem-1.5.3...

My system is OS X Snow Leopard running Ruby 1.9.1 p378

undefined method `source_index' for Gem:Module

Getting an error when generating a new project

My rvm points to /opt/twitter/rvm/.

ruby (master) ~࿔ newgem codexrb
undefined method `source_index' for Gem:Module
  /opt/twitter/rvm/gems/ruby-2.0.0-p645/gems/rubigen-1.5.8/lib/rubigen/lookup.rb:284:in `generator_full_paths'
  /opt/twitter/rvm/gems/ruby-2.0.0-p645/gems/rubigen-1.5.8/lib/rubigen/lookup.rb:272:in `each'
  /opt/twitter/rvm/gems/ruby-2.0.0-p645/gems/rubigen-1.5.8/lib/rubigen/lookup.rb:171:in `to_a'
  /opt/twitter/rvm/gems/ruby-2.0.0-p645/gems/rubigen-1.5.8/lib/rubigen/lookup.rb:171:in `block in cache'
  /opt/twitter/rvm/gems/ruby-2.0.0-p645/gems/rubigen-1.5.8/lib/rubigen/lookup.rb:171:in `each'
  /opt/twitter/rvm/gems/ruby-2.0.0-p645/gems/rubigen-1.5.8/lib/rubigen/lookup.rb:171:in `inject'
  /opt/twitter/rvm/gems/ruby-2.0.0-p645/gems/rubigen-1.5.8/lib/rubigen/lookup.rb:171:in `cache'
  /opt/twitter/rvm/gems/ruby-2.0.0-p645/gems/rubigen-1.5.8/lib/rubigen/lookup.rb:152:in `lookup'
  /opt/twitter/rvm/gems/ruby-2.0.0-p645/gems/rubigen-1.5.8/lib/rubigen/lookup.rb:165:in `instance'
  /opt/twitter/rvm/gems/ruby-2.0.0-p645/gems/rubigen-1.5.8/lib/rubigen/scripts.rb:32:in `run'
  /opt/twitter/rvm/gems/ruby-2.0.0-p645/gems/newgem-1.5.3/bin/newgem:28:in `<top (required)>'
  /opt/twitter/rvm/gems/ruby-2.0.0-p645/bin/newgem:23:in `load'
  /opt/twitter/rvm/gems/ruby-2.0.0-p645/bin/newgem:23:in `<main>'
  /opt/twitter/rvm/gems/ruby-2.0.0-p645/bin/ruby_executable_hooks:15:in `eval'
  /opt/twitter/rvm/gems/ruby-2.0.0-p645/bin/ruby_executable_hooks:15:in `<main>'
ruby (master) ~࿔ ruby -v
ruby 2.0.0p645 (2015-04-13 revision 50299) [x86_64-darwin14.4.0]

activesupport dependency

In doing the package review for Fedora it was noted that activesupport is required but seemingly not referenced in the code. Though it does look like rubigen pulls it in.

Can the reference be removed?

Newgem won't install on Ruby 1.9.1

RedCloth fails to build because you have a specific version specified as dependant. That version does not build on Ruby 1.9.1, but later versions do (4.2.2 for example).

Can you please change or remove that dependency?

Updates due on newgem.rubyforge.org

Great gem, however, the prose on newgem.rubyforge.org is slightly out of date. In the "Setup" section, you still refer to "config/hoe.rb" for configuration, but that's in the "Rakefile" now.

couple test issues

Using Debian's version of rake rubygems isn't already loaded resulting in

mkent@fortaleza:~/.gem/ruby/1.8/gems/newgem-1.5.2$ rake -T
(in /home/mkent/.gem/ruby/1.8/gems/newgem-1.5.2)
rake aborted!
undefined method `gem' for main:Object
/home/mkent/.gem/ruby/1.8/gems/newgem-1.5.2/Rakefile:1
(See full trace by running task with --trace)
mkent@fortaleza:~/.gem/ruby/1.8/gems/newgem-1.5.2$

possible to add "require 'rubygems'" prior to 'gem'?

Also there appears to be one failing test:

  1) Failure:
test_newgem(TestNewgemGenerator)
    [/usr/lib/ruby/gems/1.8/gems/rubigen-1.5.2/lib/rubigen/helpers/generator_test_helper.rb:58:in `assert_directory_exists'
     ./test/test_newgem_generator.rb:21:in `test_newgem']:
The directory 'tasks' should exist.
 is not true.

looking at the newgem generator I'm guessing the assert is unnecessary?

Can't require 'newgem' when ActiveSupport 3.0.0.beta is installed

Gem::LoadError: can't activate activesupport (= 2.3.5, runtime) for ["rubigen-1.5.4", "newgem-1.5.2"], already activated activesupport-3.0.0.beta for ["newgem-1.5.2"]

Rubigen has a hard dependency on 2.3.5, but newgem just depends on >= 2.0.2; when requiring newgem, RubyGems will pull in the most recent version of ActiveSupport, which will break if any versions > 2.3.5 are installed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.