cohortservice 0.0.1

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 853262ea94273beeeccafee5c7c205383ddc01a4
4
+ data.tar.gz: 705c325d3223f14083c98e0d79438456f0ac1f01
5
+ SHA512:
6
+ metadata.gz: 0e1765a5cd74525c173725feeb05a4b70eedc78d94629d23e95d6ae84370609cfc949cc7f90d78beb9013d13272ef8f1e5edf5eed5803b98563add49cc7d27f1
7
+ data.tar.gz: 94c14b776ee3898b9428eb91fc04dc7cbe1700e4d96a2543121eb39c988de26f7dddb1769c33058ca72a0cf4cfa371e464825ca4d01e0988278c024324579ab1
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.2.1
5
+ before_install: gem install bundler -v 1.12.5
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at dlinch33@gmail.com. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cohortservice.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # Cohortservice
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/cohortservice`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'cohortservice'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install cohortservice
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cohortservice. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "cohortservice"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'cohortservice/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "cohortservice"
8
+ spec.version = Cohortservice::VERSION
9
+ spec.authors = ["Derik Linch"]
10
+ spec.email = ["dev@galvanize.com"]
11
+
12
+ spec.summary ='Source of truth for all your Galvanize cohort or campus woes.'
13
+ spec.homepage = "http://www.galvanize.com"
14
+
15
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
16
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
17
+ if spec.respond_to?(:metadata)
18
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
19
+ else
20
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
21
+ end
22
+
23
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
+ spec.bindir = "exe"
25
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
+ spec.require_paths = ["lib"]
27
+
28
+ spec.add_development_dependency "bundler", "~> 1.12"
29
+ spec.add_development_dependency "rake", "~> 10.0"
30
+ spec.add_development_dependency "rspec", "~> 3.0"
31
+ end
@@ -0,0 +1,3 @@
1
+ module Cohortservice
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,92 @@
1
+ require "cohortservice/version"
2
+ require "data/data"
3
+ require "date"
4
+
5
+ module Cohortservice
6
+
7
+ def self.address(campus)
8
+ @data = Data.data
9
+ return nil unless @data[:campuses][campus.to_sym]
10
+ @data[:campuses][campus.to_sym][:address]
11
+ end
12
+
13
+ def self.latlon(campus)
14
+ @data = Data.data
15
+ return nil unless @data[:campuses][campus.to_sym]
16
+ latlng = {}
17
+ latlng[:lat] = @data[:campuses][campus.to_sym][:lat]
18
+ latlng[:lon] = @data[:campuses][campus.to_sym][:long]
19
+ latlng
20
+ end
21
+
22
+ def self.cohort_info(cohort_label)
23
+ # return nil unless validate_cohort cohort_label
24
+ cohort = cohort_label.split('-')
25
+ cohort_info = {}
26
+
27
+ date = Date.parse("01-#{cohort[0]}-20#{cohort[1]}")
28
+ end_date = date+184
29
+
30
+ education = define_education cohort[2]
31
+ campus = define_campus cohort[3]
32
+
33
+ cohort_info[:start_date_full] = date
34
+ cohort_info[:start_date] = "#{date.mon} #{date.year}"
35
+ cohort_info[:end_date_full] = end_date
36
+ cohort_info[:end_date] = "#{end_date.mon} #{end_date.year}"
37
+ cohort_info[:education] = education
38
+ cohort_info[:campus] = campus
39
+ cohort_info[:campus_info] = @data[:campuses][campus.to_sym]
40
+
41
+ cohort_info
42
+ end
43
+
44
+ private
45
+
46
+ def self.define_education(education_code)
47
+ case education_code
48
+ when 'DS'
49
+ education = 'Data Science'
50
+ when 'FS', 'WD'
51
+ education = 'Web Development'
52
+ when 'GU'
53
+ education = 'Galvanize University'
54
+ else
55
+ education = ''
56
+ end
57
+ education
58
+ end
59
+
60
+ def self.define_campus(campus_code)
61
+ case campus_code
62
+ when 'DG'
63
+ campus = 'Denver - Golden Triangle'
64
+ when 'DP'
65
+ campus = 'Denver - Platte'
66
+ when 'SF'
67
+ campus = 'San Francisco - SoMa'
68
+ when 'AUS'
69
+ campus = 'Austin - 2nd St District'
70
+ when 'SEA'
71
+ campus = 'Seattle - Pioneer Square'
72
+ when 'BD'
73
+ campus = 'Boulder - Walnut St.'
74
+ when 'FC'
75
+ campus = 'Fort Collins - Old Town'
76
+ when 'PHX'
77
+ campus = 'Phoenix - Warehouse District'
78
+ when 'NYC'
79
+ campus = 'New York - Soho West'
80
+ else
81
+ campus = ''
82
+ end
83
+ campus
84
+ end
85
+
86
+ def self.validate_cohort(cohort_label)
87
+ @data[:cohorts].each do |c|
88
+ return true if c == cohort_label
89
+ end
90
+ false
91
+ end
92
+ end
data/lib/data/data.rb ADDED
@@ -0,0 +1,21 @@
1
+ class Data
2
+ def self.data
3
+
4
+ @data = {
5
+ campuses: {
6
+ 'Denver - Golden Triangle': {address: '1062 Delaware St, Denver, CO 80204', lat: 39.733513, long: -104.992588},
7
+ 'Denver - Platte': {address: '1644 Platte St, Denver, CO 80202', lat: 39.757657, long: -105.006953},
8
+ 'Boulder - West Pearl': {address: '1035 Pearl St, Boulder, CO 80302', lat: 40.017786, long: -105.281948},
9
+ 'Boulder - Walnut St.': {address: '1023 Walnut Street Boulder CO 80302', lat: 40.016545, long: -105.281686},
10
+ 'Fort Collins - Old Town': {address: '242 Linden St, Fort Collins, CO 80524', lat: 40.588511, long: -105.074243},
11
+ 'San Francisco - SoMa': {address: '44 Tehama St, San Francisco, CA 94105', lat: 37.787601, long: -122.396643},
12
+ 'Seattle - Pioneer Square': {address: '111 S Jackson St, Seattle, WA 98104', lat: 47.598962, long: -122.333799},
13
+ 'Austin - 2nd St District': {address: '118 Nueces St, Austin, TX 78701', lat: 30.266114, long: -97.749945},
14
+ 'New York - Soho West': {address: '315 Hudson St, New York, NY 10013', lat: 40.726388, long: -74.007792},
15
+ 'Phoenix - Warehouse District': {address: '111 W. Monroe, Suite 602, Phoenix, AZ 85003', lat: 33.450012, long: -112.075619},
16
+ },
17
+ cohorts: ['16-01-FS-DG', '16-01-DS-SF', '16-01-GU-SF', '16-02-DS-DP', '16-02-FS-BD', '16-02-DS-SEA', '16-02-FS-SEA', '16-02-DS-SF', '16-02-FS-SF', '16-04-FS-BD', '16-04-FS-SF', '16-04-FS-DP', '16-04-DE-SF', '16-04-DS-SF-B', '16-04-DS-SF-A', '16-04-FS-AUS', '16-04-FS-FC', '16-05-FS-SEA', '16-05-FS-DP', '16-05-DS-AUS', '16-05-DS-DP', '16-05-DS-SEA', '16-05-DS-SF', '16-07-FS-DP', '16-07-FS-DG', '15-03-GU-SF', '16-08-DS-SF', '16-08-FS-BD', '16-08-FS-AUS', '16-08-FS-SEA', '15-08-GU-SF', '15-07-FS-SEA', '15-07-FS-BD', '15-07-DS-SEA', '15-06-DS-SF', '15-09-DS-SF', '15-04-FS-BD', '15-07-DS-DP', '15-10-FS-DP', '15-10-DS-DP', '15-04-FS-SF', '14-01-DS-SF', '15-10-FS-FC', '15-08-FS-SF', '14-06-FS-DG', '14-10-FS-BD', '15-05-FS-DP', '15-11-FS-DP', '14-05-DS-SF', '15-10-DS-SEA', '15-07-DS-SF', '15-01-DS-SF', '15-10-FS-SF', '15-01-FS-BD', '14-03-FS-BD', '13-09-DS-SF', '13-01-FS-DG', '14-09-DS-SF', '13-09-FS-DG', '15-01-FS-DG', '15-07-FS-DG', '15-04-DS-SF', '14-10-FS-SF', '15-10-DE-SF', '15-10-DS-SF', '16-08-DS-AUS', '16-08-GU-SF', '16-08-DS-DP', '16-09-FS-SF', '16-09-DS-SEA', '16-09-DS-SF', '16-09-DS-SF-B', '16-10-FS-BD]']
18
+ }
19
+ end
20
+
21
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cohortservice
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Derik Linch
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-10-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.12'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ description:
56
+ email:
57
+ - dev@galvanize.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".rspec"
64
+ - ".travis.yml"
65
+ - CODE_OF_CONDUCT.md
66
+ - Gemfile
67
+ - README.md
68
+ - Rakefile
69
+ - bin/console
70
+ - bin/setup
71
+ - cohortservice.gemspec
72
+ - lib/cohortservice.rb
73
+ - lib/cohortservice/version.rb
74
+ - lib/data/data.rb
75
+ homepage: http://www.galvanize.com
76
+ licenses: []
77
+ metadata:
78
+ allowed_push_host: https://rubygems.org
79
+ post_install_message:
80
+ rdoc_options: []
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ requirements: []
94
+ rubyforge_project:
95
+ rubygems_version: 2.4.8
96
+ signing_key:
97
+ specification_version: 4
98
+ summary: Source of truth for all your Galvanize cohort or campus woes.
99
+ test_files: []