Skip to content

Commit

Permalink
(paused for help)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdewey committed Apr 2, 2024
1 parent f22d32c commit c4b8aee
Show file tree
Hide file tree
Showing 16 changed files with 144 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ruby '~> 3.2.3'
# Modules
path 'modules' do
gem 'accredited_representative_portal'
gem 'analytics'
gem 'appeals_api'
gem 'apps_api'
gem 'ask_va_api'
Expand Down
3 changes: 2 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ PATH
remote: modules
specs:
accredited_representative_portal (0.1.0)
analytics (0.1.0)
appeals_api (0.0.1)
jsonapi-serializer (>= 2.2.0)
sidekiq
Expand Down Expand Up @@ -1073,7 +1074,6 @@ GEM

PLATFORMS
java
ruby
x64-mingw32
x86-mingw32
x86-mswin32
Expand All @@ -1086,6 +1086,7 @@ DEPENDENCIES
activerecord-import
activerecord-postgis-adapter
addressable
analytics!
apivore!
appeals_api!
apps_api!
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@

# Modules
mount AccreditedRepresentativePortal::Engine, at: '/accredited_representative_portal'
mount Analytics::Engine, at: '/analytics'
mount AskVAApi::Engine, at: '/ask_va_api'
mount Avs::Engine, at: '/avs'
mount CheckIn::Engine, at: '/check_in'
Expand Down
16 changes: 16 additions & 0 deletions modules/analytics/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

source 'https://rubygems.org'

# Declare your gem's dependencies in analytics.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec

# Declare any dependencies that are still in development here instead of in
# your gemspec. These might include edge Rails or gems from your path or
# Git. Remember to move these dependencies to your gemspec before releasing
# your gem to rubygems.org.

# To use a debugger
# gem 'byebug', group: [:development, :test]
10 changes: 10 additions & 0 deletions modules/analytics/README.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
= Analytics
TODO: Short description and motivation.

== Installation
Ensure the following line is in the root project's Gemfile:

gem 'analytics', path: 'modules/analytics'

== License
This module is open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
31 changes: 31 additions & 0 deletions modules/analytics/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# frozen_string_literal: true

begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end

require 'rdoc/task'

RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'Analytics'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.md')
rdoc.rdoc_files.include('lib/**/*.rb')
end

load 'rails/tasks/statistics.rake'

require 'bundler/gem_tasks'

require 'rake/testtask'

Rake::TestTask.new(:test) do |t|
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end

task default: :test
20 changes: 20 additions & 0 deletions modules/analytics/analytics.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

$LOAD_PATH.push File.expand_path('lib', __dir__)

# Maintain your gem's version:
require 'analytics/version'

# Describe your gem and declare its dependencies:
Gem::Specification.new do |spec|
spec.name = 'analytics'
spec.version = Analytics::VERSION
spec.authors = ['Mark Dewey']
spec.email = ['[email protected]']
spec.homepage = 'https://api.va.gov'
spec.summary = 'An api.va.gov module'
spec.description = 'This module was auto-generated please update this description'
spec.license = 'CC0-1.0'

spec.files = Dir['{app,config,db,lib}/**/*', 'Rakefile', 'README.md']
end
10 changes: 10 additions & 0 deletions modules/analytics/app/controllers/HashesController.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module Analytics

Check failure on line 1 in modules/analytics/app/controllers/HashesController.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Naming/FileName: The name of this source file (`HashesController.rb`) should use snake_case.

Check failure on line 1 in modules/analytics/app/controllers/HashesController.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Style/FrozenStringLiteralComment: Missing frozen string literal comment.
module V0
class HashesController < ApplicationController
def index
data = { hello: 'world' }
render json: data
end
end
end
end
12 changes: 12 additions & 0 deletions modules/analytics/bin/rails
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

ENGINE_ROOT = File.expand_path('../..', __dir__)
ENGINE_PATH = File.expand_path('../../lib/analytics/engine', __dir__)

# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __dir__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])

require 'rails/all'
require 'rails/engine/commands'
7 changes: 7 additions & 0 deletions modules/analytics/config/routes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

Analytics::Engine.routes.draw do
namespace :v0, defaults: { format: 'json' } do
get '/user/hashes', to: 'hashes#index'
end
end
7 changes: 7 additions & 0 deletions modules/analytics/lib/analytics.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

require 'analytics/engine'

module Analytics
# Your code goes here...
end
12 changes: 12 additions & 0 deletions modules/analytics/lib/analytics/engine.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Analytics
class Engine < ::Rails::Engine
isolate_namespace Analytics
config.generators.api_only = true

initializer 'model_core.factories', after: 'factory_bot.set_factory_paths' do
FactoryBot.definition_file_paths << File.expand_path('../../spec/factories', __dir__) if defined?(FactoryBot)
end
end
end
5 changes: 5 additions & 0 deletions modules/analytics/lib/analytics/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

module Analytics
VERSION = '0.1.0'
end
8 changes: 8 additions & 0 deletions modules/analytics/spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

# Configure Rails Envinronment
ENV['RAILS_ENV'] = 'test'

require 'rspec/rails'

RSpec.configure { |config| config.use_transactional_fixtures = true }
1 change: 1 addition & 0 deletions spec/simplecov_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def self.add_filters
def self.add_modules
# Modules
add_group 'AccreditedRepresentativePortal', 'modules/accredited_representative_portal/'
add_group 'Analytics', 'modules/analytics/'
add_group 'AppealsApi', 'modules/appeals_api/'
add_group 'AskVAApi', 'modules/ask_va_api/'
add_group 'Avs', 'modules/avs/'
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@

# Modules
add_group 'AccreditedRepresentativePortal', 'modules/accredited_representative_portal/'
add_group 'Analytics', 'modules/analytics/'
add_group 'AppealsApi', 'modules/appeals_api/'
add_group 'AppsApi', 'modules/apps_api'
add_group 'AskVAApi', 'modules/ask_va_api/'
Expand Down

0 comments on commit c4b8aee

Please sign in to comment.