xing-framework 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: addc27df560e0f0aed4ccfe54fa7840a6a4af6d0
4
+ data.tar.gz: d395393a30e21f2a1125c8f868c14f551e4d6ba9
5
+ SHA512:
6
+ metadata.gz: 60304c5cc7a007f7e90c2a6eefe5d875bea53134870fd92870432179f3b3e31455eeec8d55ef77e6f9001d8c1df30452f19bde2b61188902eff3278edf5f6865
7
+ data.tar.gz: 8d662f73c833321248963beb49c828beffec7ac3623ffc68092a6c673ae81d3474b20773bd0a0a6bdb72eec14b84909a0581c6c11437613cf41f6cc3f213a209
data/bin/xing ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+
4
+ include_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
5
+ $: << include_path
6
+
7
+ require 'xing/cli'
8
+ Xing::CLI.new.handle_cli
data/lib/xing.rb ADDED
@@ -0,0 +1,4 @@
1
+ module Xing
2
+ end
3
+
4
+ require 'xing/cli'
data/lib/xing/cli.rb ADDED
@@ -0,0 +1,55 @@
1
+ require 'byebug'
2
+
3
+ module Xing
4
+ class CLI
5
+ SUPPORTED_VERBS = %w{new}
6
+ #SUPPORTED_VERBS = %w{new scaffold}
7
+ require 'trollop'
8
+
9
+ BANNER = <<-EOS
10
+ Xing Framework new project and code generator. See http://github.com/XingFramework/xing-framework for platform info.
11
+
12
+ Usage:
13
+ xing [options] <command> [command options]
14
+
15
+ Supported commands currently include: #{SUPPORTED_VERBS.join(", ")}
16
+
17
+ Examples:
18
+ xing new fabulous # Generates a new Xing Framework project called 'fabulous'
19
+
20
+ Global Options:
21
+ EOS
22
+
23
+ def handle_cli
24
+ Trollop::options do
25
+ banner BANNER
26
+ framework_version =
27
+ begin
28
+ Gem::Specification.find_by_name("xing-framework").version
29
+ rescue Gem::LoadError
30
+ "<developement-version>"
31
+ end
32
+ version "Xing CLI #{framework_version} (c) 2015 Logical Reality Design, Inc."
33
+ stop_on SUPPORTED_VERBS
34
+ end
35
+
36
+ command = ARGV.shift
37
+ case command
38
+ when 'new'
39
+ opts = Trollop::options do
40
+ opt :cms, "Include content management architecture. (coming soon)"
41
+ stop_on ['name']
42
+ end
43
+ name = ARGV.shift
44
+ Trollop::die "Please specify a project name with 'xing new <name>'" unless name
45
+ Trollop::die "The CMS option is not yet implemented." if opts[:cms]
46
+ Xing::CLI::Generators::NewProject.new.generate(opts.merge({:name => name}))
47
+ else
48
+ Trollop::die "Unknown command. Supported commands are [" + SUPPORTED_VERBS.join(" ") + "]"
49
+ end
50
+
51
+ end
52
+ end
53
+ end
54
+
55
+ require 'xing/cli/generators'
@@ -0,0 +1 @@
1
+ require 'xing/cli/generators/new_project'
@@ -0,0 +1,30 @@
1
+ require 'caliph'
2
+
3
+ module Xing::CLI::Generators
4
+ class NewProject
5
+ include Caliph::CommandLineDSL
6
+
7
+ BASE_PROJECT_URL = "git@github.com:XingFramework/xing-application-base.git"
8
+
9
+ # For the moment, this is the simplest thing that can work. Zero templating is done
10
+ # so the project will still have the default module names etc.
11
+ def generate(options)
12
+ shell = Caliph.new()
13
+ command = cmd('git', 'clone', '--depth=1', '--branch=master', BASE_PROJECT_URL, options[:name])
14
+ result = shell.run(command)
15
+
16
+ if result.succeeded?
17
+ remove_git_directory(options[:name], shell)
18
+ else
19
+ raise "Attempt to clone base git repository failed!"
20
+ end
21
+ end
22
+
23
+ def remove_git_directory(name, shell)
24
+ git_dir = File.join("#{name}", ".git")
25
+ if File.exists?(git_dir)
26
+ shell.run(cmd('rm -rf', git_dir))
27
+ end
28
+ end
29
+ end
30
+ end
data/spec/null_spec.rb ADDED
@@ -0,0 +1,7 @@
1
+ require 'xing'
2
+
3
+ describe "the tests" do
4
+ it "should run" do
5
+ expect(1 + 1).to eql(2)
6
+ end
7
+ end
@@ -0,0 +1,17 @@
1
+ puts Dir::pwd
2
+ require 'test/unit'
3
+ begin
4
+ require 'spec'
5
+ rescue LoadError
6
+ false
7
+ end
8
+
9
+ class RSpecTest < Test::Unit::TestCase
10
+ def test_that_rspec_is_available
11
+ assert_nothing_raised("\n\n * RSpec isn't available - please run: gem install rspec *\n\n"){ ::Spec }
12
+ end
13
+
14
+ def test_that_specs_pass
15
+ assert(system(*%w{spec -f e -p **/*.rb spec}),"\n\n * Specs failed *\n\n")
16
+ end
17
+ end
@@ -0,0 +1,23 @@
1
+ require 'codeclimate-test-reporter'
2
+ CodeClimate::TestReporter.start
3
+ SimpleCov.start
4
+
5
+ require 'rspec'
6
+ require 'rspec/core/formatters/base_formatter'
7
+ require 'cadre/rspec3'
8
+
9
+ ENV["RAILS_ENV"] ||= 'test'
10
+
11
+
12
+ ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
13
+ Dir[File.join(ENGINE_RAILS_ROOT, "spec_help/support/**/*.rb")].each {|f| require f }
14
+
15
+ RSpec.configure do |config|
16
+ config.run_all_when_everything_filtered = true
17
+ config.add_formatter(Cadre::RSpec3::NotifyOnCompleteFormatter)
18
+ config.add_formatter(Cadre::RSpec3::QuickfixFormatter)
19
+
20
+ config.around(:type => :deprecation) do |example|
21
+ ActiveSupport::Deprecation.silence(&example)
22
+ end
23
+ end
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: xing-framework
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Evan Dorn
8
+ - Judson Lester
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2015-10-19 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: trollop
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: 2.1.0
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: 2.1.0
28
+ - !ruby/object:Gem::Dependency
29
+ name: caliph
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: 0.3.0
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: 0.3.0
42
+ description: |2
43
+ The Xing Framework is a hypermedia-enabled Rails + AngularJS web and mobile development platform.
44
+ This gem contains the generator for initializing a new Xing project.
45
+ email:
46
+ - evan@lrdesign.com
47
+ - judson@lrdesign.com
48
+ executables:
49
+ - xing
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - bin/xing
54
+ - lib/xing.rb
55
+ - lib/xing/cli.rb
56
+ - lib/xing/cli/generators.rb
57
+ - lib/xing/cli/generators/new_project.rb
58
+ - spec/null_spec.rb
59
+ - spec_help/gem_test_suite.rb
60
+ - spec_help/spec_helper.rb
61
+ homepage: ''
62
+ licenses:
63
+ - MIT
64
+ metadata: {}
65
+ post_install_message: Welcome to the exciting new world of Xing web development!
66
+ rdoc_options:
67
+ - "--inline-source"
68
+ - "--main"
69
+ - doc/README
70
+ - "--title"
71
+ - xing-framework-0.0.1 Documentation
72
+ require_paths:
73
+ - lib/
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ required_rubygems_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ requirements: []
85
+ rubyforge_project: xing-framework
86
+ rubygems_version: 2.4.8
87
+ signing_key:
88
+ specification_version: 4
89
+ summary: Code generator tools for the Xing Framework.
90
+ test_files:
91
+ - spec_help/gem_test_suite.rb