noe 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. data/CHANGELOG.md +27 -0
  2. data/Gemfile +2 -0
  3. data/LICENCE.md +22 -0
  4. data/README.md +111 -45
  5. data/Rakefile +18 -20
  6. data/bin/noe +1 -1
  7. data/lib/noe.rb +7 -21
  8. data/lib/noe/commons.rb +23 -0
  9. data/lib/noe/config.yaml +2 -2
  10. data/lib/noe/ext/array.rb +18 -0
  11. data/lib/noe/ext/hash.rb +48 -0
  12. data/lib/noe/go.rb +158 -40
  13. data/lib/noe/install.rb +13 -7
  14. data/lib/noe/list.rb +34 -10
  15. data/lib/noe/loader.rb +67 -0
  16. data/lib/noe/main.rb +15 -15
  17. data/lib/noe/prepare.rb +121 -0
  18. data/lib/noe/show_spec.rb +45 -0
  19. data/lib/noe/template.rb +84 -4
  20. data/noe.gemspec +186 -30
  21. data/spec/ext/hash/methodize_spec.rb +30 -0
  22. data/spec/noe_spec.rb +4 -0
  23. data/spec/spec_helper.rb +0 -2
  24. data/spec/template/entry/infer_wlang_dialect_spec.rb +31 -0
  25. data/tasks/gem.rake +44 -0
  26. data/tasks/spec_test.rake +61 -0
  27. data/tasks/unit_test.rake +56 -0
  28. data/tasks/yard.rake +36 -0
  29. data/templates/ruby/CHANGELOG.md +9 -1
  30. data/templates/ruby/README.md +47 -10
  31. data/templates/ruby/noespec.yaml +195 -26
  32. data/templates/ruby/short.yaml +33 -0
  33. data/templates/ruby/src/Gemfile +2 -0
  34. data/templates/ruby/src/LICENCE.md +22 -0
  35. data/templates/ruby/src/Manifest.txt +11 -0
  36. data/templates/ruby/src/README.md +6 -1
  37. data/templates/ruby/src/Rakefile +16 -36
  38. data/templates/ruby/src/__lower__.gemspec +178 -23
  39. data/templates/ruby/src/lib/__lower__.rb +5 -2
  40. data/templates/ruby/src/lib/__lower__/loader.rb +65 -0
  41. data/templates/ruby/src/spec/spec_helper.rb +0 -2
  42. data/templates/ruby/src/tasks/gem.rake +44 -0
  43. data/templates/ruby/src/tasks/spec_test.rake +61 -0
  44. data/templates/ruby/src/tasks/unit_test.rake +56 -0
  45. data/templates/ruby/src/tasks/yard.rake +36 -0
  46. metadata +349 -79
  47. data/LICENCE.txt +0 -20
  48. data/lib/noe/create.rb +0 -77
  49. data/templates/ruby/src/LICENCE.txt +0 -20
@@ -1,20 +0,0 @@
1
- Copyright (c) 2011 - Bernard Lambeau
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,77 +0,0 @@
1
- require 'fileutils'
2
- module Noe
3
- class Main
4
- #
5
- # Create a fresh new project
6
- #
7
- # SYNOPSIS
8
- # #{program_name} #{command_name} [options] PROJECT_NAME
9
- #
10
- # OPTIONS
11
- # #{summarized_options}
12
- #
13
- # DESCRIPTION
14
- # This command guides you with the creation of a new project whose
15
- # name is given as first argument. A new folder is created and a .noespec
16
- # file is generated in it. The template specified in ~/.noerc under :default
17
- # is used by default. Use --template to override this.
18
- #
19
- # After creation, you'll have to edit the generated .noespec file then run
20
- # 'noe go' in the new directory.
21
- #
22
- # TYPICAL USAGE
23
- #
24
- # # start creation of a ruby project
25
- # noe create --ruby hello_world
26
- # cd hello_world
27
- #
28
- # # edit the configuration
29
- # edit hello_world.noespec
30
- #
31
- # # launch template generation
32
- # noe go
33
- #
34
- class Create < Quickl::Command(__FILE__, __LINE__)
35
- include Noe::Commons
36
-
37
- # Install options
38
- options do |opt|
39
- opt.on('--template=TPLNAME',
40
- 'Set the template to use') do |name|
41
- config.default = name
42
- end
43
- end
44
-
45
- def execute(args)
46
- raise Quickl::Help unless args.size == 1
47
-
48
- # get project name and check folder and template
49
- pname = args.first
50
- if File.exists?(pname)
51
- raise Noe::Error, "File #{pname} already exists, remove it first."
52
- end
53
- tpl = template
54
-
55
- # create folder now
56
- FileUtils.mkdir(pname)
57
-
58
- # instantiate the configuration
59
- File.open(File.join(pname, "#{pname}.noespec"), 'w') do |out|
60
- context = {'template_name' => tpl.name}
61
- out << WLang::file_instantiate(tpl.spec_file, context, "wlang/active-string")
62
- end
63
-
64
- # what's next
65
- puts "Project successfully started !"
66
- puts
67
- puts "What's next?"
68
- puts " * cd #{pname}"
69
- puts " * vim #{pname}.noespec"
70
- puts " * noe go"
71
- puts
72
- puts "Thank you for using Noe (v#{Noe::VERSION}), enjoy!"
73
- end
74
-
75
- end # class Create
76
- end # class Main
77
- end # module Noe
@@ -1,20 +0,0 @@
1
- Copyright (c) !{Time.now.strftime('%Y')} - !{author}
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.