Repository: thoughtbot/proteus Branch: master Commit: a7c8fe5fa6f9 Files: 14 Total size: 9.3 KB Directory structure: gitextract_jwqlroy7/ ├── .gitignore ├── CONTRIBUTING.md ├── Gemfile ├── LICENSE.md ├── README.md ├── Rakefile ├── bin/ │ └── proteus ├── lib/ │ ├── proteus/ │ │ ├── kit.rb │ │ ├── repos.rb │ │ └── version.rb │ └── proteus.rb ├── proteus-kits.gemspec └── spec/ ├── proteus_spec.rb └── spec_helper.rb ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ *gem .DS_store Gemfile.lock pkg tmp spec/dummy ================================================ FILE: CONTRIBUTING.md ================================================ We love pull requests from everyone. By participating in this project, you agree to abide by the thoughtbot [code of conduct]. Here’s a quick guide: [code of conduct]: https://thoughtbot.com/open-source-code-of-conduct 1. Fork the repository. 2. Make your changes in a topic branch. 3. Squash your commits into a single one (more on that [here](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html)). 4. Rebase against `origin/master`, push to your fork and submit a pull request. At this point you’re waiting on us. We like to at least comment on, if not accept, pull requests within three business days (and, typically, one business day). We may suggest some changes or improvements or alternatives. Some things that will increase the chance that your pull request is accepted: * Write your code according to the [thoughtbot Style Guide][guide] * Fix a bug, refactor code or expand an existing feature. * Use the right syntax and naming conventions. * Update parts of the documentation that are affected by your contribution. [guide]: https://github.com/thoughtbot/guides/tree/master/style **Git Commit Messages** * Capitalize your commit messages. * Start your message with a verb. * Use present tense. * Refer to the issue/PR number in your squashed commit message. ================================================ FILE: Gemfile ================================================ source 'https://rubygems.org' gemspec ================================================ FILE: LICENSE.md ================================================ The MIT License (MIT) Copyright © 2014–2016 [thoughtbot, inc.](http://thoughtbot.com) 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. ================================================ FILE: README.md ================================================ # Proteus **Note:** Proteus is no longer being actively maintained. Proteus is a collection of useful starter kits to help you prototype faster. They follow the [thoughtbot styleguide](https://github.com/thoughtbot/guides) and includes our favorite front-end development tools. ## Kits * [Middleman](http://github.com/thoughtbot/proteus-middleman) * [Jekyll](http://github.com/thoughtbot/proteus-jekyll) * Have a request for another kit? Open an issue to let us know. ## Installation 1. Install the Proteus gem using the [RubyGems](https://rubygems.org) package manager: ```bash gem install proteus-kits ``` 2. Then kick off a new project with the kit you want to use (i.e. Middleman): ```bash proteus new middleman your-project-name ``` ## Shortcuts We’ve also included some handy shortcuts with Proteus: - Install dependencies and clear the Git remote: ```bash proteus setup ``` - Start the kit-specific server (i.e. `bundle exec middleman server`): ```bash proteus server ``` - Run the kit-specific deploy (i.e. `middleman deploy`): ```bash proteus deploy ``` ## Contributing If you'd like to contribute a feature or bugfix: Thanks! To make sure your fix/feature has a high chance of being included, please read the following guidelines: 1. Fork the repository 2. Make your changes 3. Push your branch to your fork 4. Post a [pull request](https://github.com/thoughtbot/proteus/compare). Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more details on contributing and running test. Thank you to all [the contributors](https://github.com/thoughtbot/proteus-middleman/contributors)! ## Credits [![thoughtbot](http://images.thoughtbot.com/bourbon/thoughtbot-logo.svg)](http://thoughtbot.com) Proteus is maintained and funded by [thoughtbot, inc](http://thoughtbot.com). Thank you to all of [the contributors](https://github.com/thoughtbot/proteus-middleman/contributors)! ## License Copyright © 2014–2016 [thoughtbot, inc](http://thoughtbot.com). Proteus is free software, and may be redistributed under the terms specified in the [license](LICENSE.md). ================================================ FILE: Rakefile ================================================ require "bundler/gem_tasks" require "rspec/core/rake_task" RSpec::Core::RakeTask.new task :default => :spec task :test => :spec ================================================ FILE: bin/proteus ================================================ #!/usr/bin/env ruby require 'rubygems' begin require 'proteus/kit' rescue LoadError => e warn 'Could not load "proteus/kit"' exit -1 end Proteus::Kit.start ================================================ FILE: lib/proteus/kit.rb ================================================ require "proteus/version" require "proteus/repos" require "thor" module Proteus class Kit < Thor include Thor::Actions no_commands do def url(id) kit = Proteus::REPOS[id.to_sym] kit[:url] end def name(id) kit = Proteus::REPOS[id.to_sym] kit[:name] end end desc "list", "shows a list of available kits" def list repos = Proteus::REPOS repos.each do |id, repo| puts "#{id} - #{repo[:name]}" end end desc "new", "runs the command to clone a particular kit" def new(id, dir = nil) dir ||= id kit = Proteus::REPOS[id.to_sym] if kit name = kit[:name] url = kit[:url] if system "git ls-remote #{url} #{dir} > /dev/null 2>&1" puts "Starting a new #{name} project in #{dir} from #{url}" system %{ git clone "#{url}" "#{dir}" && cd "#{dir}" && rm -rf .git && git init && git add . && git commit -m 'New #{name} project' && cd - } else puts "Can't find a repo at #{url}." end else puts "Kit not found. Run `proteus list` to see available kits." end end desc "setup", "Sets up the project" def setup puts "Setting up your project" system "bin/setup" end desc "server", "Runs the server" def server puts "Starting the server" system "bin/server" end desc "deploy", "Deploys the site to Github" def deploy puts "Deploying the site to Github" system "bin/deploy" end desc "version", "Show Proteus version" def version version_number = Proteus::VERSION puts "Proteus #{version_number}" end end end ================================================ FILE: lib/proteus/repos.rb ================================================ module Proteus REPOS = { middleman: { name: "Middleman Starter", url: "https://github.com/thoughtbot/proteus-middleman.git" }, jekyll: { name: "Jekyll Starter", url: "https://github.com/thoughtbot/proteus-jekyll.git" } } end ================================================ FILE: lib/proteus/version.rb ================================================ module Proteus VERSION = "0.4" end ================================================ FILE: lib/proteus.rb ================================================ require "proteus/version" require "proteus/repos" require "proteus/kit" ================================================ FILE: proteus-kits.gemspec ================================================ # coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "proteus/version" Gem::Specification.new do |spec| spec.name = "proteus-kits" spec.version = Proteus::VERSION spec.authors = ["Joshua Ogle"] spec.email = ["support@thoughtbot.com"] spec.summary = %q{Starter kits to help you prototype faster} spec.description = %q{A collection of useful starter kits to help you prototype faster} spec.homepage = "http://github.com/thoughtbot/proteus" spec.license = "MIT" spec.files = `git ls-files`.split($/) spec.executable = "proteus" spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] spec.add_development_dependency "bundler", "~> 1.7" spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency "rspec", "~> 3.3" spec.add_dependency "thor", "~> 0.19" end ================================================ FILE: spec/proteus_spec.rb ================================================ require "spec_helper" describe Proteus do before do remove_dummy_repo @proteus = Proteus::Kit.new @repos = Proteus::REPOS end it "has a list of repos" do expect(@repos).not_to be_nil end it "gets repos in the list" do expect(@repos.size).to be > 0 end it "gets the kit name" do expect(@proteus.name("jekyll")).to eq("Jekyll Starter") end it "gets the Git url" do url = "https://github.com/thoughtbot/proteus-middleman.git" expect(@proteus.url("middleman")).to eq(url) end it "displays a list of repos" do expect { @proteus.list }.to output().to_stdout end it "displays a friendly message if the kit isn't in the list" do message = "Kit not found. Run `proteus list` to see available kits.\n" expect { @proteus.new("invalid") }.to output(message).to_stdout end it "displays the current version" do version = Proteus::VERSION expect { @proteus.version }.to output("Proteus #{version}\n").to_stdout end def remove_dummy_repo FileUtils.rm_rf(Dir["./spec/dummy"]) end end ================================================ FILE: spec/spec_helper.rb ================================================ $LOAD_PATH << File.join('../lib') require 'proteus' def quietly streams = STDOUT, STDERR on_hold = streams.collect { |stream| stream.dup } streams.each do |stream| stream.reopen(null_stream) stream.sync = true end yield ensure streams.each_with_index do |stream, i| stream.reopen(on_hold[i]) end end def null_stream if RUBY_PLATFORM =~ /mswin/ 'NUL:' else '/dev/null' end end