appgen 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b07f98fd882628e6000b99387910394390eb3848
4
- data.tar.gz: 9d496def66c24e80ff68ad7f1c35789c4ab897eb
3
+ metadata.gz: 124c8365461d39d54d076e72bfcfa7171e8b9455
4
+ data.tar.gz: 3b5e05aef2ea8a74723f22503e77c7bdc55822f1
5
5
  SHA512:
6
- metadata.gz: 855caf8711f48712d2e645fe3c7ff4e94650655e883fa73e076e546c4dcbee0c92785c4c177cbc3254f911c7a5fabf6b0a3d918df6279150d92af368c0d95204
7
- data.tar.gz: '087f4d8cfbeb86e6fe0ed7f7f68eef0cb06af58ffd253f214f80c81e99718d016d79962702a72d656d322839794a3ed64907ad40b30c5f72191321c03cec7c30'
6
+ metadata.gz: c9aec89cfeb9030555749eb66c15dfa2db72e6642679ad916e4f3e13529e559d3876780695517f0dfb44e1b0c57ea77aa1413e63045febd1ba4716101d54a637
7
+ data.tar.gz: 51329008b640be887dffb1499487a1e902309c2bf3390d2767dcbb29f3d893f94f8dee91d9f4b6cbeeb17c8f574a34bb21ab6ccb846dd133db5f1ed2ee727878
@@ -0,0 +1 @@
1
+ 2.3.1
data/README.md CHANGED
@@ -5,17 +5,7 @@ Describe your app in a text file, then run appgen.
5
5
 
6
6
  ## Installation
7
7
 
8
- Add this line to your application's Gemfile:
9
-
10
- ```ruby
11
- gem 'appgen'
12
- ```
13
-
14
- And then execute:
15
-
16
- $ bundle
17
-
18
- Or install it yourself as:
8
+ Install the gem:
19
9
 
20
10
  $ gem install appgen
21
11
 
@@ -30,6 +20,10 @@ If you want to use a specific file, then do
30
20
 
31
21
  $ appgen a_specific_file.txt
32
22
 
23
+ Or you can work with an online file
24
+
25
+ $ appgen https://raw.githubusercontent.com/arnaudlevy/appgen/master/examples/blogdemo.txt
26
+
33
27
  ## Writing app descriptions
34
28
 
35
29
  Here is the rails blog demonstration as appgen description:
@@ -19,8 +19,6 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_dependency "thor"
23
-
24
22
  spec.add_development_dependency "bundler", "~> 1.15"
25
23
  spec.add_development_dependency "rake", "~> 10.0"
26
24
  end
@@ -0,0 +1,7 @@
1
+ The app name is blogdemo.
2
+ There are posts.
3
+ A post has a title, a text (as text), a user, and comments.
4
+ There are users.
5
+ A user has a name.
6
+ There are comments.
7
+ A comment has a user.
@@ -0,0 +1,8 @@
1
+ The app name is mytodolist.
2
+ There are actions.
3
+ An action has a title, a done status (boolean) and a user.
4
+ There are users.
5
+ A user has a first name, a last name, and an email.
6
+ Users can login.
7
+ The app has an admin area.
8
+ The app is hosted on heroku.
data/exe/appgen CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'appgen/cli'
3
- Appgen::CLI.start
3
+ Appgen::CLI.execute ARGV[0]
@@ -1,12 +1,4 @@
1
1
  require 'appgen/version'
2
- require 'thor'
3
2
 
4
3
  module Appgen
5
- class CLI < Thor
6
-
7
- desc "appgen", "Generates app from description"
8
- def appgen
9
-
10
- end
11
- end
12
4
  end
@@ -0,0 +1,12 @@
1
+ require 'appgen/loader'
2
+ require 'appgen/generator'
3
+
4
+ module Appgen
5
+ class CLI
6
+ def self.execute(path=nil)
7
+ puts 'Welcome to Appgen'
8
+ app = Appgen::Loader.load path
9
+ Appgen::Generator.generate app
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,7 @@
1
+ module Appgen
2
+ class Generator
3
+ def self.generate(app)
4
+ puts 'Generating app'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,27 @@
1
+ require 'open-uri'
2
+
3
+ module Appgen
4
+ class Loader
5
+ def self.load(path=nil)
6
+ path = find_local_path if path.nil?
7
+ puts 'No description found, you should add an app description in a file, or call appgen with a path or url.' and return if path.nil?
8
+ read_description path
9
+ end
10
+
11
+ def self.find_local_path
12
+ Dir['*'].each do |entry|
13
+ next if File.directory? entry
14
+ next if entry.start_with? '.'
15
+ puts "Found file named #{entry}"
16
+ return entry
17
+ end
18
+ end
19
+
20
+ def self.read_description(path)
21
+ puts "Loading app description from #{path}"
22
+ app = open(path) { |f| f.read }
23
+ puts app
24
+ app
25
+ end
26
+ end
27
+ end
@@ -1,3 +1,3 @@
1
1
  module Appgen
2
- VERSION = "0.0.1"
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appgen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arnaud Levy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-17 00:00:00.000000000 Z
11
+ date: 2017-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: thor
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: bundler
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -61,6 +47,7 @@ extensions: []
61
47
  extra_rdoc_files: []
62
48
  files:
63
49
  - ".gitignore"
50
+ - ".ruby-version"
64
51
  - CODE_OF_CONDUCT.md
65
52
  - Gemfile
66
53
  - LICENSE
@@ -69,8 +56,13 @@ files:
69
56
  - appgen.gemspec
70
57
  - bin/console
71
58
  - bin/setup
59
+ - examples/blogdemo.txt
60
+ - examples/mytodolist.txt
72
61
  - exe/appgen
73
62
  - lib/appgen.rb
63
+ - lib/appgen/cli.rb
64
+ - lib/appgen/generator.rb
65
+ - lib/appgen/loader.rb
74
66
  - lib/appgen/version.rb
75
67
  homepage: https://github.com/arnaudlevy/appgen
76
68
  licenses: []
@@ -91,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
83
  version: '0'
92
84
  requirements: []
93
85
  rubyforge_project:
94
- rubygems_version: 2.5.2
86
+ rubygems_version: 2.5.1
95
87
  signing_key:
96
88
  specification_version: 4
97
89
  summary: Rails prototyping is fast, appgen intends to make it even faster!