fresnel 0.5.4
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.
- data/README.markdown +151 -0
- data/Rakefile +54 -0
- data/bin/fresnel +17 -0
- data/fresnel.gemspec +36 -0
- data/lib/fresnel.rb +479 -0
- data/lib/fresnel/cache.rb +72 -0
- data/lib/fresnel/cli.rb +87 -0
- data/lib/fresnel/date_parser.rb +5 -0
- data/lib/fresnel/frame.rb +40 -0
- data/lib/fresnel/lighthouse.rb +386 -0
- data/lib/fresnel/setup_wizard.rb +54 -0
- metadata +98 -0
@@ -0,0 +1,54 @@
|
|
1
|
+
class SetupWizard
|
2
|
+
def self.global(fresnel)
|
3
|
+
if File.exists?(fresnel.global_config_file)
|
4
|
+
config=YAML::load_file(fresnel.global_config_file)
|
5
|
+
end
|
6
|
+
|
7
|
+
config=Hash.new unless config
|
8
|
+
puts "================================================"
|
9
|
+
puts " Fresnel - #{fresnel.app_description} "
|
10
|
+
puts " config wizard "
|
11
|
+
puts "================================================"
|
12
|
+
puts
|
13
|
+
config['account']=ask("My lighthouse account is : ") do |q|
|
14
|
+
q.validate = /^\w+$/
|
15
|
+
q.responses[:not_valid]="\nError :\nThat seems to be incorrect, we would like to have the <account> part in\nhttp://<account>.lighthouseapp.com , please try again"
|
16
|
+
q.responses[:ask_on_error]="My lighthouse account is : "
|
17
|
+
q.default=config['account']||ENV['USER']
|
18
|
+
end
|
19
|
+
|
20
|
+
puts
|
21
|
+
puts "what token would you like to use for the account : #{config['account']} ?"
|
22
|
+
config['token']=ask("My lighthouse token is : ") do |q|
|
23
|
+
q.validate = /^[0-9a-f]{40}$/
|
24
|
+
q.responses[:not_valid]="\nError :\nThat seems to be incorrect, we would like to have your lighthouse token\n this looks something like : 1bd25cc2bab1fc4384b7edfe48433fba5f6ee43c"
|
25
|
+
q.responses[:ask_on_error]="My lighthouse token is : "
|
26
|
+
q.default=config['token'] if config['token']
|
27
|
+
end
|
28
|
+
Lighthouse.account=config['account']
|
29
|
+
Lighthouse.token=config['token']
|
30
|
+
user_id=Lighthouse::Token.get(fresnel.token)['user_id']
|
31
|
+
config['user_id']=ask("My lighthouse user_id is : ", Integer) do |q|
|
32
|
+
q.default=user_id
|
33
|
+
end
|
34
|
+
|
35
|
+
puts "generated your config in #{fresnel.global_config_file}, going on with main program..."
|
36
|
+
File.open(fresnel.global_config_file,'w+'){ |f| f.write(YAML::dump(config)) }
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.project(fresnel)
|
40
|
+
config=Hash.new
|
41
|
+
data=fresnel.projects(:object=>true)
|
42
|
+
current_dir=File.expand_path(".").split("/").last
|
43
|
+
fresnel.projects(:selectable=>true, :clear=>false, :setup=>true)
|
44
|
+
|
45
|
+
project_id=ask("please select which project # resides here : ", Integer) do |q|
|
46
|
+
q.validate = /^\d+$/
|
47
|
+
q.below=data.size
|
48
|
+
q.responses[:ask_on_error]="This project is # : "
|
49
|
+
end
|
50
|
+
config['project_id']=data[project_id].id
|
51
|
+
puts "generated your config in #{fresnel.project_config_file}, going on with main program..."
|
52
|
+
File.open(fresnel.project_config_file,'w+'){ |f| f.write(YAML::dump(config)) }
|
53
|
+
end
|
54
|
+
end
|
metadata
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fresnel
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Gerard de Brieder
|
8
|
+
- Wes Oldenbeuving
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2009-12-04 00:00:00 +01:00
|
14
|
+
default_executable:
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: activesupport
|
18
|
+
type: :runtime
|
19
|
+
version_requirement:
|
20
|
+
version_requirements: !ruby/object:Gem::Requirement
|
21
|
+
requirements:
|
22
|
+
- - ">="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: 2.3.0
|
25
|
+
version:
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: terminal-table
|
28
|
+
type: :runtime
|
29
|
+
version_requirement:
|
30
|
+
version_requirements: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 1.3.0
|
35
|
+
version:
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: highline
|
38
|
+
type: :runtime
|
39
|
+
version_requirement:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 1.5.1
|
45
|
+
version:
|
46
|
+
description: Fresnel is a console manager to LighthouseApp.com using the official lighthouse api.
|
47
|
+
email: smeevil@gmail.com
|
48
|
+
executables:
|
49
|
+
- fresnel
|
50
|
+
extensions: []
|
51
|
+
|
52
|
+
extra_rdoc_files:
|
53
|
+
- README.markdown
|
54
|
+
files:
|
55
|
+
- README.markdown
|
56
|
+
- Rakefile
|
57
|
+
- fresnel.gemspec
|
58
|
+
- bin/fresnel
|
59
|
+
- lib/fresnel.rb
|
60
|
+
- lib/fresnel/cache.rb
|
61
|
+
- lib/fresnel/cli.rb
|
62
|
+
- lib/fresnel/date_parser.rb
|
63
|
+
- lib/fresnel/frame.rb
|
64
|
+
- lib/fresnel/lighthouse.rb
|
65
|
+
- lib/fresnel/setup_wizard.rb
|
66
|
+
has_rdoc: true
|
67
|
+
homepage: http://www.github.com/smeevil/fresnel
|
68
|
+
licenses: []
|
69
|
+
|
70
|
+
post_install_message:
|
71
|
+
rdoc_options:
|
72
|
+
- --inline-source
|
73
|
+
- --line-numbers
|
74
|
+
- --main
|
75
|
+
- README.rdoc
|
76
|
+
require_paths:
|
77
|
+
- lib
|
78
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.8.0
|
83
|
+
version:
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: "0"
|
89
|
+
version:
|
90
|
+
requirements: []
|
91
|
+
|
92
|
+
rubyforge_project:
|
93
|
+
rubygems_version: 1.3.5
|
94
|
+
signing_key:
|
95
|
+
specification_version: 3
|
96
|
+
summary: Fresnel is a console manager to LighthouseApp.com using the official lighthouse api.
|
97
|
+
test_files: []
|
98
|
+
|