Permalink
Browse files

renaming to upmin

  • Loading branch information...
joncalhoun committed Aug 6, 2014
1 parent fdde7ef commit 55e2c0b3bcee32c0a45e1a980fefa2b5e77c120b
Showing with 121 additions and 121 deletions.
  1. +1 −1 Gemfile
  2. +2 −2 Gemfile.lock
  3. +1 −1 Rakefile
  4. 0 app/assets/images/{jetty_admin → upmin}/.keep
  5. BIN app/assets/images/{jetty_admin → upmin}/logo_small.png
  6. 0 app/assets/javascripts/{jetty_admin → upmin}/application.js
  7. +8 −8 app/assets/javascripts/{jetty_admin → upmin}/models.js
  8. +5 −5 app/assets/javascripts/{jetty_admin → upmin}/run.js
  9. 0 app/assets/stylesheets/{jetty_admin → upmin}/application.css
  10. 0 app/assets/stylesheets/{jetty_admin → upmin}/base.css.scss
  11. 0 app/assets/stylesheets/{jetty_admin → upmin}/models.css.scss
  12. +1 −1 app/controllers/{jetty_admin → upmin}/application_controller.rb
  13. +4 −4 app/controllers/{jetty_admin → upmin}/models_controller.rb
  14. +3 −3 app/helpers/{jetty_admin → upmin}/application_helper.rb
  15. +1 −1 app/helpers/{jetty_admin → upmin}/models_helper.rb
  16. +3 −3 app/views/layouts/{jetty_admin → upmin}/application.html.haml
  17. 0 app/views/{jetty_admin → upmin}/models/_search_result.html.haml
  18. +1 −1 app/views/{jetty_admin → upmin}/models/list.html.haml
  19. +3 −3 app/views/{jetty_admin → upmin}/models/search.html.haml
  20. +1 −1 bin/rails
  21. +4 −4 config/routes.rb
  22. BIN jetty_admin-0.0.2.gem
  23. +0 −41 lib/jetty_admin.rb
  24. +0 −11 lib/jetty_admin/railtie.rb
  25. +1 −1 lib/tasks/{jetty_admin_tasks.rake → upmin_tasks.rake}
  26. +41 −0 lib/upmin.rb
  27. +6 −6 lib/{jetty_admin → upmin}/active_record.rb
  28. +2 −2 lib/{jetty_admin → upmin}/engine.rb
  29. +1 −1 lib/{jetty_admin → upmin}/model.rb
  30. +11 −0 lib/upmin/railtie.rb
  31. +1 −1 lib/{jetty_admin → upmin}/server.rb
  32. +2 −2 lib/{jetty_admin → upmin}/server/client.rb
  33. +1 −1 lib/{jetty_admin → upmin}/server/company.rb
  34. +1 −1 lib/{jetty_admin → upmin}/server/model.rb
  35. +1 −1 lib/{jetty_admin → upmin}/version.rb
  36. +1 −1 test/controllers/{jetty_admin → upmin}/model_controller_test.rb
  37. +1 −1 test/dummy/config/application.rb
  38. +1 −1 test/dummy/config/routes.rb
  39. +1 −1 test/helpers/{jetty_admin → upmin}/model_helper_test.rb
  40. +0 −7 test/jetty_admin_test.rb
  41. +7 −0 test/upmin_test.rb
  42. +4 −4 jetty_admin.gemspec → upmin.gemspec
View
@@ -1,6 +1,6 @@
source "https://rubygems.org"
# Declare your gem's dependencies in jetty_admin.gemspec.
# Declare your gem's dependencies in upmin.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec
View
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
jetty_admin (0.0.1)
upmin (0.0.1)
rails (~> 4.0.0)
typhoeus
@@ -87,4 +87,4 @@ PLATFORMS
ruby
DEPENDENCIES
jetty_admin!
upmin!
View
@@ -8,7 +8,7 @@ require 'rdoc/task'
RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'JettyAdmin'
rdoc.title = 'Upmin'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
File renamed without changes.
@@ -24,7 +24,7 @@ var Models = {
facets: [],
// list of disjunctive facets (checkbox to refine)
disjunctiveFacets: ['jetty_model'],
disjunctiveFacets: ['upmin_model'],
// number of results per page
hitsPerPage: 10
@@ -104,18 +104,18 @@ var Models = {
$searchResult.find('.icon-outer')
.removeClass()
.addClass('icon-outer')
.addClass(findModelColor(hit.jetty_model));
.addClass(findModelColor(hit.upmin_model));
$searchResult.find('.icon-letter').text(hit.jetty_model[0]);
$searchResult.find('.icon-name').text(hit.jetty_model);
$searchResult.find('.icon-letter').text(hit.upmin_model[0]);
$searchResult.find('.icon-name').text(hit.upmin_model);
$searchResult.find('.icon-id').text(hit.id);
var dl = $searchResult.find('dl.dl-horizontal');
dl.html('');
$.each(Object.keys(hit), function(index, key) {
if(key == "_highlightResult" || key == "objectID" ||
key == "id" || key == "jetty_model") {
key == "id" || key == "upmin_model") {
return;
}
@@ -203,8 +203,8 @@ var Models = {
};
if (window.JettyAdmin == null) {
window.JettyAdmin = {};
if (window.Upmin == null) {
window.Upmin = {};
}
window.JettyAdmin.Models = Models;
window.Upmin.Models = Models;
@@ -1,12 +1,12 @@
function runJettyAdmin() {
var JettyAdmin = window.JettyAdmin;
function runUpmin() {
var Upmin = window.Upmin;
var controller = $("body").data("controller");
var action = $("body").data("action");
if ("object" === typeof JettyAdmin) {
if ("object" === typeof Upmin) {
// Check if a controller specific initializer exists.
var Controller = JettyAdmin[controller];
var Controller = Upmin[controller];
if ("object" === typeof Controller) {
Controller.init();
@@ -18,4 +18,4 @@ function runJettyAdmin() {
}
}
};
$(document).ready(runJettyAdmin);
$(document).ready(runUpmin);
@@ -1,4 +1,4 @@
module JettyAdmin
module Upmin
class ApplicationController < ActionController::Base
end
end
@@ -1,11 +1,11 @@
require_dependency "jetty_admin/application_controller"
require_dependency "upmin/application_controller"
module JettyAdmin
module Upmin
class ModelsController < ApplicationController
before_action :set_model, only: [:updated_since]
def list
@models = JettyAdmin::Model.all
@models = Upmin::Model.all
respond_to do |format|
format.html
format.json { render json: @models.map{|m| m.to_s} }
@@ -30,7 +30,7 @@ def search
private
def set_model
@model = JettyAdmin::Model.find(params[:model_name])
@model = Upmin::Model.find(params[:model_name])
end
end
end
@@ -1,14 +1,14 @@
module JettyAdmin
module Upmin
module ApplicationHelper
def body_classes
controller = "c-#{params[:controller].gsub(/_/, "-").gsub("jetty-admin/", "")}"
controller = "c-#{params[:controller].gsub(/_/, "-").gsub("upmin-admin/", "")}"
action = "a-#{params[:action].gsub(/_/, "-")}"
return [controller, action]
end
def body_data
ret = {}
ret[:controller] = params[:controller].camelize.gsub("JettyAdmin::", "")
ret[:controller] = params[:controller].camelize.gsub("Upmin::", "")
ret[:action] = params[:action].camelize
return ret
end
@@ -1,4 +1,4 @@
module JettyAdmin
module Upmin
module ModelsHelper
end
end
@@ -1,9 +1,9 @@
!!!
%html
%head
%title JettyAdmin
= stylesheet_link_tag "jetty_admin/application", media: "all"
= javascript_include_tag "jetty_admin/application"
%title Upmin
= stylesheet_link_tag "upmin/application", media: "all"
= javascript_include_tag "upmin/application"
= csrf_meta_tags
%link{href: "//cdn.jsdelivr.net/bootstrap/3.2.0/css/bootstrap.min.css", rel: "stylesheet", type: "text/css"}
@@ -1,6 +1,6 @@
%h1
Models
- JettyAdmin::Model.all.each do |model|
- Upmin::Model.all.each do |model|
%p
= model.to_s
@@ -2,7 +2,7 @@
.container
.navbar-header
%a.navbar-brand{href: root_path}
= image_tag("jetty_admin/logo_small.png")
= image_tag("upmin/logo_small.png")
etty Admin
.search-container
.input-group.input-group-lg.m-t
@@ -13,8 +13,8 @@
.data-container.hidden
.algolia-data{ data: { api_key: "042cb73b78c6a18a1ba5120d49a97ba8", index: "c1" } }
.models-data
- JettyAdmin::Server::Model.all.each do |jetty_model|
.model{data: { color: jetty_model.color }, class: jetty_model.name }
- Upmin::Server::Model.all.each do |upmin_model|
.model{data: { color: upmin_model.color }, class: upmin_model.name }
.container
.row
View
@@ -2,7 +2,7 @@
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
ENGINE_ROOT = File.expand_path('../..', __FILE__)
ENGINE_PATH = File.expand_path('../../lib/jetty_admin/engine', __FILE__)
ENGINE_PATH = File.expand_path('../../lib/upmin/engine', __FILE__)
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
View
@@ -1,12 +1,12 @@
JettyAdmin::Engine.routes.draw do
Upmin::Engine.routes.draw do
root to: "models#search"
scope :models do
get "/", as: :jetty_models, controller: :models, action: :list
get "/", as: :upmin_models, controller: :models, action: :list
scope "/:model_name" do
get "/", as: :jetty_model, controller: :models, action: :show
get "/updated_since", as: :jetty_updated_since, controller: :models, action: :updated_since
get "/", as: :upmin_model, controller: :models, action: :show
get "/updated_since", as: :upmin_updated_since, controller: :models, action: :updated_since
end
end
# resources :models, only: [:show, :index] do
View
BIN -29.5 KB jetty_admin-0.0.2.gem
Binary file not shown.
View

This file was deleted.

Oops, something went wrong.
View

This file was deleted.

Oops, something went wrong.
@@ -1,4 +1,4 @@
# desc "Explaining what the task does"
# task :jetty_admin do
# task :upmin do
# # Task goes here
# end
View
@@ -0,0 +1,41 @@
require "upmin/engine"
require "upmin/model"
# Server Clients
require "upmin/server"
require "upmin/server/client"
require "upmin/server/company"
require "upmin/server/model"
require "upmin/active_record"
# require "upmin/active_record_relation"
require "upmin/railtie"
require "typhoeus"
require "haml"
require "sass-rails"
module Upmin
def Upmin.api_key=(api_key)
@@api_key = api_key
# Upmin.notify_upmin
end
def Upmin.api_key
if (defined? @@api_key)
return @@api_key
else
raise "Jetty API key is not set."
end
end
# def Upmin.notify_upmin
# # TODO(jon): Add if prod check here (and maybe other spots?)
# resp = Typhoeus.get(init_url, followlocation: true, params: { api_key: Upmin.api_key })
# puts JSON.parse(resp.body)
# end
end
@@ -1,19 +1,19 @@
require 'active_support/concern'
module JettyAdmin
module Upmin
end
module JettyAdmin::ActiveRecord
module Upmin::ActiveRecord
extend ActiveSupport::Concern
included do
after_save :notify_jetty_of_save
after_save :notify_upmin_of_save
end
def notify_jetty_of_save
# if JettyAdmin::Model.search_indexes[self.class.to_s]
def notify_upmin_of_save
# if Upmin::Model.search_indexes[self.class.to_s]
# # TODO(jon): Post a message to Jetty with: [class, id]
# puts "Called notify_jetty_of_save"
# puts "Called notify_upmin_of_save"
# end
end
@@ -1,7 +1,7 @@
# require 'haml-rails'
module JettyAdmin
module Upmin
class Engine < ::Rails::Engine
isolate_namespace JettyAdmin
isolate_namespace Upmin
end
end
@@ -1,4 +1,4 @@
module JettyAdmin
module Upmin
class Model
attr_accessor :rails_model
View
@@ -0,0 +1,11 @@
module Upmin
require 'rails'
class Railtie < Rails::Railtie
initializer('upmin.insert_into_active_record') do
ActiveSupport.on_load(:active_record) do
::ActiveRecord::Base.send(:include, Upmin::ActiveRecord)
# ::ActiveRecord::Relation.send(:include, Upmin::ActiveRecordRelation)
end
end
end
end
@@ -1,4 +1,4 @@
module JettyAdmin
module Upmin
module Server
end
@@ -1,4 +1,4 @@
module JettyAdmin
module Upmin
module Server
class Client
@@ -11,7 +11,7 @@ def Client.all
root_url,
followlocation: true,
params: {
api_key: JettyAdmin.api_key
api_key: Upmin.api_key
}
)
return JSON.parse(resp.body).map{ |data| self.new(data) }
Oops, something went wrong.

0 comments on commit 55e2c0b

Please sign in to comment.