teamster 0.5.2 → 0.6.0

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: 6e76b37337e49222827cebb76cd1cbe07a4f8d5a
4
- data.tar.gz: 8ba4ec1c274bd059680d2633aa365d4ba7d476b2
3
+ metadata.gz: 4e736afb7a2726e1fb47099a1f973798daf15dea
4
+ data.tar.gz: 1c0f8d0134cfacb9277385158b1b4fe10d678e40
5
5
  SHA512:
6
- metadata.gz: cc35029e478e5f736767b8300907e4541b30081371b7bd176a49700f3bb77fd7f8013cb1c1d09f1c58ea9c38678f6c7590dcfe4ab75e8fa24b6b351f7af96f4a
7
- data.tar.gz: 4988ec1e71391719b5e855df8ce0a6699ef5dcdf6d469a3835f86477aa869528b2523071d898e3a7984e9d9a6f80035f4692abef25482232a2897feac2ed9fd4
6
+ metadata.gz: 6fc3f93e01b8ec2ed889a6f7c685e8dad3e77f9815618885b818a3ab93208ba01fc5c628500aef548027099e31a2418713a65a30504c36c423d4fc8d0145fe45
7
+ data.tar.gz: 658ce956cf16dcfcd1d9379b9f5185ae83d9a265468860984812abf5bf9288da8da07ed38f4262f2295e4bcfab6e012cab349a8b867e739bbdef4d1f19f21dd5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.2
1
+ 0.6.0
data/bin/teamster CHANGED
@@ -71,10 +71,10 @@ class TeamsterApp
71
71
  FileUtils.cp_r "#{content}/views", current_working_folder
72
72
  FileUtils.cp_r "#{content}/public", current_working_folder
73
73
  create_file "config.ru", "config_ru"
74
- FileUtils.mkdir_p "lib/teamster-modules"
75
- create_file "lib/teamster-modules.rb", "teamster_modules"
74
+ FileUtils.mkdir_p "lib/teamster-adapters"
75
+ create_file "lib/teamster-adapters.rb", "teamster_adapters"
76
76
  puts "Teamster initialized!"
77
- puts "- Run \"teamster create <NAME>\" to create a placeholder module."
77
+ puts "- Run \"teamster create <NAME>\" to create a placeholder adapter."
78
78
  puts "- Run \"teamster start\" to start teamster!"
79
79
  end
80
80
 
@@ -116,17 +116,17 @@ class TeamsterApp
116
116
 
117
117
  def create(*args)
118
118
  name = args[0]
119
- create_module_for name.downcase
119
+ create_adapter_for name.downcase
120
120
  end
121
121
 
122
122
  def import(*args)
123
123
  name = args[0]
124
- import_module_for name.downcase
124
+ import_adapter_for name.downcase
125
125
  end
126
126
 
127
127
  def export(*args)
128
128
  name = args[0]
129
- export_module_for name.downcase
129
+ export_adapter_for name.downcase
130
130
  end
131
131
 
132
132
  # --{ HELPERS }-- #
@@ -1,7 +1,7 @@
1
1
  <h1 class='text-center'>Status At A Glance</h1>
2
2
  <hr class="fancy-line">
3
3
  <div class='row'>
4
- <% all_modules(true).each_with_index do |arr, i| %>
4
+ <% all_adapters(true).each_with_index do |arr, i| %>
5
5
  <% link, name = arr %>
6
6
  <div class=<%= summary_div_class_for i%>>
7
7
  <div class="frontpage-panel panel panel-default">
@@ -12,14 +12,14 @@
12
12
  <div>
13
13
  <ul class="nav navbar-nav">
14
14
  <li class="dropdown">
15
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">Modules <b class="caret"></b></a>
15
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">Adapters <b class="caret"></b></a>
16
16
  <ul class="dropdown-menu">
17
17
  <li role="presentation" class="dropdown-header">Available</li>
18
- <% available_modules.each do |link, name| %>
18
+ <% available_adapters.each do |link, name| %>
19
19
  <li><a href=<%= link %>><%= name %></a></li>
20
20
  <% end %>
21
21
  <li role="presentation" class="dropdown-header">Under Development</li>
22
- <% developing_modules.each do |link, name| %>
22
+ <% developing_adapters.each do |link, name| %>
23
23
  <li><a href=<%= link %>><%= name %></a></li>
24
24
  <% end %>
25
25
  </ul>
data/lib/teamster-cli.rb CHANGED
@@ -43,46 +43,46 @@ module Teamster
43
43
  STDIN.gets.strip
44
44
  end
45
45
 
46
- def create_module_for(name)
47
- puts "Creating placeholders for module #{name}...\n"
48
- FileUtils.mkdir_p "lib/teamster-modules/#{name}/views"
49
- create_file "lib/teamster-modules/#{name}.rb", "module_placeholder_for", name
50
- create_file "lib/teamster-modules/#{name}/#{name}_helper.rb", "module_helper_placeholder_for", name
51
- create_file "lib/teamster-modules/#{name}/views/#{name}.erb", "view_placeholder_for", name
52
- create_file "lib/teamster-modules/#{name}/views/#{name}_summary.erb", "view_summary_placeholder_for", name
53
- puts "\nBasic module creation done!"
54
- puts "Controller : \"lib/teamster-modules/#{name}.rb\""
55
- puts "Helper : \"lib/teamster-modules/#{name}/#{name}_helper.rb\""
56
- puts "View : \"lib/teamster-modules/#{name}/views/#{name}.erb\""
57
- puts "Summary View : \"lib/teamster-modules/#{name}/views/#{name}_summary.erb\""
58
- end
59
-
60
- def import_module_for(name)
61
- puts "Importing module: #{name}"
46
+ def create_adapter_for(name)
47
+ puts "Creating placeholders for adapter #{name}...\n"
48
+ FileUtils.mkdir_p "lib/teamster-adapters/#{name}/views"
49
+ create_file "lib/teamster-adapters/#{name}.rb", "adapter_placeholder_for", name
50
+ create_file "lib/teamster-adapters/#{name}/#{name}_helper.rb", "adapter_helper_placeholder_for", name
51
+ create_file "lib/teamster-adapters/#{name}/views/#{name}.erb", "view_placeholder_for", name
52
+ create_file "lib/teamster-adapters/#{name}/views/#{name}_summary.erb", "view_summary_placeholder_for", name
53
+ puts "\nBasic adapter creation done!"
54
+ puts "Controller : \"lib/teamster-adapters/#{name}.rb\""
55
+ puts "Helper : \"lib/teamster-adapters/#{name}/#{name}_helper.rb\""
56
+ puts "View : \"lib/teamster-adapters/#{name}/views/#{name}.erb\""
57
+ puts "Summary View : \"lib/teamster-adapters/#{name}/views/#{name}_summary.erb\""
58
+ end
59
+
60
+ def import_adapter_for(name)
61
+ puts "Importing adapter: #{name}"
62
62
  zip_file = "#{name}.zip"
63
63
  if File.exists?(zip_file)
64
64
  if `which unzip`.length != 0
65
65
  `unzip #{zip_file}`
66
66
  puts "\nSuccessfully imported #{name}. Please restart teamster to use."
67
67
  else
68
- puts "\nUnable to import module. Export depends on cli tool \"unzip\"."
68
+ puts "\nUnable to import adapter. Export depends on cli tool \"unzip\"."
69
69
  end
70
70
  else
71
71
  puts "Unable to find file: #{zip_file}"
72
72
  end
73
73
  end
74
74
 
75
- def export_module_for(name)
76
- puts "Exporting module: #{name}"
75
+ def export_adapter_for(name)
76
+ puts "Exporting adapter: #{name}"
77
77
  zip_file = "#{name}.zip"
78
78
  puts "The following files will be zipped:"
79
- puts "- lib/teamster-modules/#{name}.rb"
80
- puts '- Everything in folder lib/teamster-modules/#{name}/'
79
+ puts "- lib/teamster-adapters/#{name}.rb"
80
+ puts '- Everything in folder lib/teamster-adapters/#{name}/'
81
81
  if `which zip`.length != 0
82
- `zip -r #{zip_file} lib/teamster-modules/#{name}.rb lib/teamster-modules/#{name}/`
82
+ `zip -r #{zip_file} lib/teamster-adapters/#{name}.rb lib/teamster-adapters/#{name}/`
83
83
  puts "\nExported to #{zip_file}!"
84
84
  else
85
- puts "\nUnable to export module. Export depends on cli tool \"zip\"."
85
+ puts "\nUnable to export adapter. Export depends on cli tool \"zip\"."
86
86
  end
87
87
  end
88
88
 
@@ -132,9 +132,9 @@ Commands:
132
132
  Options (standalone):
133
133
  --help Display this detailed help.
134
134
  --version Version of the teamster used.
135
- --create-module NAME Creates a stub of a module
136
- --import-module FILE << PENDING IMPLEMENTATION >>
137
- --export-module FILE << PENDING IMPLEMENTATION >>
135
+ --create-adapter NAME Creates a stub of a adapter
136
+ --import-adapter FILE << PENDING IMPLEMENTATION >>
137
+ --export-adapter FILE << PENDING IMPLEMENTATION >>
138
138
 
139
139
 
140
140
  Options used with \"start\":
@@ -164,29 +164,29 @@ run Teamster::Core::App
164
164
  CODE
165
165
  end
166
166
 
167
- def teamster_modules
167
+ def teamster_adapters
168
168
  <<-CODE
169
- Dir.glob(File.dirname(__FILE__) + '/teamster-modules/*.rb').each do |mdl|
169
+ Dir.glob(File.dirname(__FILE__) + '/teamster-adapters/*.rb').each do |mdl|
170
170
  require mdl
171
171
  end
172
172
  CODE
173
173
  end
174
174
 
175
- def module_placeholder_for(name)
175
+ def adapter_placeholder_for(name)
176
176
  <<-CODE
177
177
  require_relative \"#{name}/#{name}_helper\"
178
178
 
179
179
  \# NOTE: If the namespace is changed, please take care of the
180
- \# namespace of the sub-class and helper modules.
180
+ \# namespace of the sub-class and helper adapters.
181
181
 
182
182
  module Teamster
183
- module Modules
183
+ module Adapters
184
184
  class #{name.capitalize} < Sinatra::Base
185
- \# Class methods that contain Teamster-Module specific helpers.
186
- include BaseModule
185
+ \# Class methods that contain Teamster-Adapter specific helpers.
186
+ include BaseAdapter
187
187
 
188
188
  \# Stuff that needs to be done before registration with core.
189
- has_helpers #{name.capitalize}Helper \# Add modules here (comma separated) if there are helper modules.
189
+ has_helpers #{name.capitalize}Helper \# Add adapters here (comma separated) if there are helper adapters.
190
190
  views_at \"\#\{File.dirname(__FILE__)\}/#{name}/views\"
191
191
  under_development \# Remove this line when development is finished.
192
192
 
@@ -202,10 +202,10 @@ end
202
202
  CODE
203
203
  end
204
204
 
205
- def module_helper_placeholder_for(name)
205
+ def adapter_helper_placeholder_for(name)
206
206
  <<-CODE
207
207
  module Teamster
208
- module Modules
208
+ module Adapters
209
209
  module #{name.capitalize}Helper
210
210
  def #{name}_summary?
211
211
  true
data/lib/teamster.rb CHANGED
@@ -9,7 +9,7 @@ require_relative 'teamster/login'
9
9
  module Teamster
10
10
  module Core
11
11
  class App < Sinatra::Base
12
- @@modules = []
12
+ @@adapters = []
13
13
  @@views = []
14
14
  @@title = 'TEAMSTER'
15
15
  @@root = Dir.pwd
@@ -38,8 +38,8 @@ module Teamster
38
38
  erb :index
39
39
  end
40
40
 
41
- def self.modules
42
- @@modules
41
+ def self.adapters
42
+ @@adapters
43
43
  end
44
44
 
45
45
  def self.views
@@ -54,23 +54,23 @@ module Teamster
54
54
  @@root
55
55
  end
56
56
 
57
- def self.use_module(teamster_module)
58
- if @@modules.include? teamster_module
59
- puts "Module #{teamster_module} already registered!"
57
+ def self.use_adapter(teamster_adapter)
58
+ if @@adapters.include? teamster_adapter
59
+ puts "Adapter #{teamster_adapter} already registered!"
60
60
  else
61
- @@modules << teamster_module
62
- @@views << teamster_module.views
61
+ @@adapters << teamster_adapter
62
+ @@views << teamster_adapter.views
63
63
  end
64
- teamster_module.helpers GeneralHelper
65
- if teamster_module.has_helper?
66
- teamster_module.helper_module.flatten.each do |mod|
64
+ teamster_adapter.helpers GeneralHelper
65
+ if teamster_adapter.has_helper?
66
+ teamster_adapter.helper_adapter.flatten.each do |mod|
67
67
  helpers mod
68
68
  end
69
69
  end
70
- use teamster_module
70
+ use teamster_adapter
71
71
  end
72
72
  end
73
73
  end
74
74
  end
75
75
 
76
- require_relative 'teamster/base_module'
76
+ require_relative 'teamster/base_adapter'
@@ -1,20 +1,20 @@
1
1
  module Teamster
2
- module Modules
3
- module BaseModule
2
+ module Adapters
3
+ module BaseAdapter
4
4
  def self.included(base)
5
5
  base.extend ClassMethods
6
6
  end
7
7
 
8
8
  module ClassMethods
9
9
  def register(klass)
10
- Teamster::Core::App.use_module klass
10
+ Teamster::Core::App.use_adapter klass
11
11
  end
12
12
 
13
- def has_helpers(*mods)
14
- if mods.size > 0
13
+ def has_helpers(*adapters)
14
+ if adapters.size > 0
15
15
  instance_eval "def has_helper?; true end"
16
- instance_eval "def helper_module; #{mods} end"
17
- mods.flatten.each {|mod| helpers mod }
16
+ instance_eval "def helper_adapter; #{adapters} end"
17
+ adapters.flatten.each {|adapter| helpers adapter }
18
18
  end
19
19
  end
20
20
 
@@ -2,7 +2,7 @@ module Teamster
2
2
  module Core
3
3
  module CoreHelper
4
4
  def summary_div_class_for(index)
5
- size = all_modules.size
5
+ size = all_adapters.size
6
6
  if size == 1
7
7
  "col-lg-12"
8
8
  elsif size%2 == 0
@@ -13,8 +13,8 @@ module Teamster
13
13
  end
14
14
  end
15
15
 
16
- def summary_of(module_name)
17
- name = module_name.downcase
16
+ def summary_of(adapter_name)
17
+ name = adapter_name.downcase
18
18
  if send(:"#{name}_summary?")
19
19
  send(:"#{name}_summary")
20
20
  else
@@ -56,33 +56,33 @@ module Teamster
56
56
  erb :footer
57
57
  end
58
58
 
59
- def available_modules(shuffle = false)
60
- available_modules = [].tap do |arr|
61
- App.modules.each do |mod|
62
- module_name = mod.to_s.split("::").last
63
- arr << ['/' + module_name.downcase, module_name] unless mod.under_development?
59
+ def available_adapters(shuffle = false)
60
+ available_adapters = [].tap do |arr|
61
+ App.adapters.each do |mod|
62
+ adapter_name = mod.to_s.split("::").last
63
+ arr << ['/' + adapter_name.downcase, adapter_name] unless mod.under_development?
64
64
  end
65
65
  end
66
- shuffle ? available_modules.shuffle : available_modules
66
+ shuffle ? available_adapters.shuffle : available_adapters
67
67
  end
68
68
 
69
- def developing_modules
69
+ def developing_adapters
70
70
  [].tap do |arr|
71
- App.modules.each do |mod|
72
- module_name = mod.to_s.split("::").last
73
- arr << ['/' + module_name.downcase, module_name] if mod.under_development?
71
+ App.adapters.each do |mod|
72
+ adapter_name = mod.to_s.split("::").last
73
+ arr << ['/' + adapter_name.downcase, adapter_name] if mod.under_development?
74
74
  end
75
75
  end
76
76
  end
77
77
 
78
- def all_modules(shuffle = false)
79
- all_modules = [].tap do |arr|
80
- App.modules.each do |mod|
81
- module_name = mod.to_s.split("::").last
82
- arr << ['/' + module_name.downcase, module_name]
78
+ def all_adapters(shuffle = false)
79
+ all_adapters = [].tap do |arr|
80
+ App.adapters.each do |mod|
81
+ adapter_name = mod.to_s.split("::").last
82
+ arr << ['/' + adapter_name.downcase, adapter_name]
83
83
  end
84
84
  end
85
- shuffle ? all_modules.shuffle : all_modules
85
+ shuffle ? all_adapters.shuffle : all_adapters
86
86
  end
87
87
 
88
88
  def find_template(views, *args, &block)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teamster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nur Muhammad Bin Sirat
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-28 00:00:00.000000000 Z
11
+ date: 2014-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puma
@@ -85,7 +85,7 @@ files:
85
85
  - content/views/no_summary.erb
86
86
  - lib/teamster-cli.rb
87
87
  - lib/teamster.rb
88
- - lib/teamster/base_module.rb
88
+ - lib/teamster/base_adapter.rb
89
89
  - lib/teamster/core_helper.rb
90
90
  - lib/teamster/general_helper.rb
91
91
  - lib/teamster/login.rb