├── .gitignore ├── Gemfile ├── LICENSE.txt ├── README.md ├── README.txt ├── Rakefile ├── designmodo-startup_framework-rails.gemspec ├── lib ├── designmodo │ └── startup_framework │ │ ├── rails.rb │ │ └── rails │ │ └── version.rb └── generators │ └── startup_framework │ ├── demo │ └── demo_generator.rb │ └── install │ ├── USAGE │ ├── install_generator.rb │ └── templates │ ├── application.css │ ├── application.js │ ├── flatui.js │ ├── startup_framework.js │ └── startup_framework.less └── test ├── install_generator_test.rb └── test_helper.rb /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | *.rbc 3 | .bundle 4 | .config 5 | .yardoc 6 | Gemfile.lock 7 | InstalledFiles 8 | _yardoc 9 | coverage 10 | doc/ 11 | lib/bundler/man 12 | pkg 13 | rdoc 14 | spec/reports 15 | test/tmp 16 | test/version_tmp 17 | tmp 18 | .idea/**/* 19 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Specify your gem's dependencies in designmodo-flatuipro-rails.gemspec 4 | gemspec 5 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Vertmac 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 17 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 20 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Startup Framework 2 | 3 | This gem integrates Designmodo's Startup Framework into the Rails 3 and 4 Asset Pipeline. 4 | 5 | You **must** purchase and download a licensed copy to use this gem (none of the assets are packaged per StartupFramework license). You may do so by clicking the above image (full disclosure: affiliate link). 6 | 7 | The version major and minors should match the Startup Framework version. Anything after these are gem versions. 8 | 9 | [![Gem Version](https://badge.fury.io/rb/designmodo-startup_framework-rails.png)](http://badge.fury.io/rb/designmodo-startup_framework-rails) 10 | 11 | ## Installation 12 | First install and configure dependencies: 13 | 14 | [less-rails](https://github.com/metaskills/less-rails) 15 | 16 | [jquery-ui-rails](https://github.com/joliss/jquery-ui-rails) 17 | 18 | [twitter-bootstrap-rails](https://github.com/seyhunak/twitter-bootstrap-rails) 19 | 20 | 21 | 22 | Add this line to your application's Gemfile: 23 | 24 | gem 'designmodo-startup_framework-rails', '~> 1.1.3.10' 25 | 26 | And then execute: 27 | 28 | $ bundle 29 | 30 | ### Install Generator 31 | One **must** run this after install *and* after update of designmodo-startup_framework-rails gem: 32 | 33 | $ rails generate startup_framework:install 34 | 35 | In case you are already using [designmodo-flatuipro-rails](https://github.com/reflection/designmodo-flatuipro-rails) please use this option, 36 | 37 | $ rails generate startup_framework:install --flatuipro false 38 | 39 | This will not copy over the bundled Flat UI files to the gem assuming that you are using [designmodo-flatuipro-rails](https://github.com/reflection/designmodo-flatuipro-rails). 40 | 41 | ###Generate Demo 42 | Before running the demo generator, it is imperative that you run the install generator. Lets say you need to generate the sample-01 of Startup Framework. **Make sure that the sample directory exists.** 43 | 44 | $ rails generate startup_framework:demo 01 45 | 46 | This will generate a route and corresponding controller/views etc called `'/startup_framework_demo/index01'` 47 | All you need to do is just 48 | 49 | $ rails server 50 | 51 | and navigate to http://localhost/startup_framework_demo/index01. You probably need to change teh image tags in case some images dont come up in the file `app/views/startup_framework_demo/index.html.erb` where `xx` stands for the sample number. 52 | 53 | The script is copied as `app/assets/javascripts/script.js` and the less file is copied as `app/assets/stylesheets.less`. You can use them as templates or modify them as your custom less files. 54 | 55 | ## Usage 56 | After running the install generator, all assets should be setup. Here goes a template for the less file in case you are making your own view 57 | 58 | /* 59 | * 60 | *= require bootstrap_and_overrides.css 61 | *= require_self 62 | */ 63 | 64 | @import 'startup_framework'; 65 | 66 | /* header */ 67 | @import '/startup-framework/ui-kit/ui-kit-header/less/header-10.less'; 68 | 69 | /* content */ 70 | @import '/startup-framework/ui-kit/ui-kit-content/less/content-3.less'; 71 | @import '/startup-framework/ui-kit/ui-kit-content/less/content-20.less'; 72 | 73 | 74 | /* footer */ 75 | @import '/startup-framework/ui-kit/ui-kit-footer/less/footer-11.less'; 76 | 77 | ## Thanks 78 | If you haven't bought it already, please buy from designmodo. 79 | 80 | 81 | ## Thanks to 82 | The idea generated from [StackOverFlow](http://stackoverflow.com/questions/23331056/designmodos-startup-framework-kit-with-ruby-on-rails/) where this particular question was raised in regards to startup-framework and rails integration. 83 | 84 | 85 | ##Queries 86 | In case of queries please contact roney.b@vertmac.com 87 | 88 | 89 | ## Contributing 90 | 91 | 1. Fork it 92 | 2. Create your feature branch (`git checkout -b my-new-feature`) 93 | 3. Commit your changes (`git commit -am 'Add some feature'`) 94 | 4. Push to the branch (`git push origin my-new-feature`) 95 | 5. Create new Pull Request 96 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | Insert some clever text here.\n 2 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require "bundler/gem_tasks" -------------------------------------------------------------------------------- /designmodo-startup_framework-rails.gemspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | lib = File.expand_path('../lib', __FILE__) 3 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 4 | require 'designmodo/startup_framework/rails/version' 5 | 6 | Gem::Specification.new do |spec| 7 | spec.name = "designmodo-startup_framework-rails" 8 | spec.version = Designmodo::StartupFramework::Rails::VERSION 9 | spec.authors = ["Vertmac"] 10 | spec.email = ["info@vertmac.com"] 11 | spec.description = %q{designmodo-startup_framework-rails integrates Startup Framework for Rails 3 and 4 Asset Pipelines} 12 | spec.summary = %q{Startup Framework for Rails 3 and 4 Asset Pipelines} 13 | spec.homepage = "https://github.com/vertmac/designmodo-startup_framework-rails" 14 | spec.license = "LGPL" 15 | 16 | spec.files = Dir["lib/**/*"] + ["LICENSE.txt", "Rakefile", "README.md"] 17 | spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } 18 | spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) 19 | spec.require_paths = ["lib"] 20 | 21 | spec.add_runtime_dependency 'less-rails-bootstrap' 22 | spec.add_runtime_dependency 'jquery-rails', '>= 2.2.1' 23 | spec.add_runtime_dependency 'jquery-ui-rails', '>= 4.0.3' 24 | spec.post_install_message = "" \ 25 | "**********************************************\n\n" \ 26 | "One *must* run `rails generate startup_framework:install `\n" \ 27 | "when gem updated\n\n" \ 28 | "**********************************************" 29 | end -------------------------------------------------------------------------------- /lib/designmodo/startup_framework/rails.rb: -------------------------------------------------------------------------------- 1 | require "designmodo/startup_framework/rails/version" 2 | 3 | module Designmodo 4 | module StartupFramework 5 | module Rails 6 | class Engine < ::Rails::Engine 7 | initializer 'designmodo-startup_framework-rails.setup', 8 | :after => 'less-rails.after.load_config_initializers', 9 | :group => :all do |app| 10 | if defined?(Less) 11 | app.config.less.paths << File.join(config.root, 'app', 'less') 12 | end 13 | end 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/designmodo/startup_framework/rails/version.rb: -------------------------------------------------------------------------------- 1 | module Designmodo 2 | module StartupFramework 3 | module Rails 4 | VERSION = "1.1.3.10" 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /lib/generators/startup_framework/demo/demo_generator.rb: -------------------------------------------------------------------------------- 1 | require 'rails/generators' 2 | require 'pathname' 3 | 4 | module StartupFramework 5 | module Generators 6 | class DemoGenerator < Rails::Generators::Base 7 | desc "Setup Startup Framework Demo page." 8 | source_root File.expand_path("../../../../../app/assets/demo", __FILE__) 9 | argument :sampleno, :type => :string, :banner => "" 10 | 11 | # Detect if Startup Framework Pro assets copied over to gem 12 | def check_startup_framework_install 13 | unless File.exist?(File.expand_path("../../../../../app/assets", __FILE__)) 14 | raise "Please run install generator first" 15 | end 16 | end 17 | 18 | def check_sample_folder 19 | unless File.exist?(File.expand_path("../../../../../app/assets/demo/sample-#{sampleno}/index.html", __FILE__)) 20 | raise "Please provide a correct sample number" 21 | end 22 | end 23 | 24 | 25 | def generate_demo_controller 26 | generate "controller startup_framework_demo index#{sampleno} --no-helper --no-test-framework --no-assets" 27 | end 28 | 29 | def add_demo_assets 30 | # Overwrite generated index.html.erb with demo html 31 | copy_file "sample-#{sampleno}/index.html.erb", "app/views/startup_framework_demo/index#{sampleno}.html.erb" 32 | 33 | # Add demo LESS 34 | copy_file "sample-#{sampleno}/less/style.less", "app/assets/stylesheets/sample#{sampleno}.less" 35 | 36 | # Handle CSS Manifest 37 | css_manifest = "app/assets/stylesheets/application.css" 38 | if File.exist?(css_manifest) 39 | content = File.read(css_manifest) 40 | unless content.match(/require_tree\s+\./) 41 | style_require_block = " *= require startup_framework_demo\n" 42 | insert_into_file css_manifest, style_require_block, :after => "require_self\n" 43 | end 44 | end 45 | 46 | #Add images 47 | directory File.join("sample-#{sampleno}","img"), File.join("app", "assets", "images","img") 48 | 49 | 50 | # Add demo javascript 51 | copy_file "sample-#{sampleno}/js/script.js", "app/assets/javascripts/script#{sampleno}.js" 52 | 53 | # Handle JS Manifest 54 | js_manifest = "app/assets/javascripts/application.js" 55 | if File.exist?(js_manifest) 56 | content = File.read(js_manifest) 57 | unless content.match(/require_tree\s+\./) 58 | insert_into_file js_manifest, "//= require script#{sampleno}\n", :after => "startup_framework\n" 59 | end 60 | end 61 | end 62 | end 63 | end 64 | end -------------------------------------------------------------------------------- /lib/generators/startup_framework/install/USAGE: -------------------------------------------------------------------------------- 1 | Description: 2 | Explain the generator 3 | 4 | Example: 5 | rails generate layout Thing 6 | 7 | This will create: 8 | what/will/it/create -------------------------------------------------------------------------------- /lib/generators/startup_framework/install/install_generator.rb: -------------------------------------------------------------------------------- 1 | require 'rails/generators' 2 | require 'pathname' 3 | 4 | module StartupFramework 5 | module Generators 6 | class InstallGenerator < Rails::Generators::Base 7 | desc "Copies licensed Startup Framework files to designmodo-startup_framework-rails gem." 8 | argument :startup_dir, :type => :string, :banner => "" 9 | class_option :flatui, :type => :boolean, :default => true, :description => 'Include bundled Flat UI' 10 | class_option :demo, :type => :boolean, :default => false, :description => 'Include bundled samples' 11 | source_root File.expand_path("../templates", __FILE__) 12 | 13 | 14 | def copy_assets 15 | @gem_assets_dir = File.expand_path("../../../../../", __FILE__) 16 | @pro_dir = startup_dir 17 | 18 | @namespace = "startup-framework" 19 | @common_files = "common-files" 20 | @ui_kit = "ui-kit" 21 | @flat_ui = "flat-ui" 22 | 23 | @fonts_dir = "fonts/#{@namespace}/#{@common_files}/fonts" 24 | @images_dir = "images/#{@namespace}/#{@common_files}" 25 | @icons_dir = "#{@images_dir}/icons" 26 | @img_dir = "#{@images_dir}/img" 27 | @less_dir = "less/#{@namespace}/#{@common_files}/less" 28 | @css_dir = "stylesheets/#{@namespace}/#{@common_files}/css" 29 | @js_dir = "javascripts/#{@namespace}/#{@common_files}/js" 30 | @target_ui_kit = "less/#{@namespace}/#{@ui_kit}" 31 | 32 | FileUtils.mkdir_p File.join(@gem_assets_dir,"app","assets",@fonts_dir) 33 | FileUtils.mkdir_p File.join(@gem_assets_dir,"app","assets",@images_dir) 34 | FileUtils.mkdir_p File.join(@gem_assets_dir,"app","assets",@js_dir) 35 | FileUtils.mkdir_p File.join(@gem_assets_dir,"app","assets",@css_dir) 36 | FileUtils.mkdir_p File.join(@gem_assets_dir,"app","assets",@less_dir) 37 | 38 | @gem_assets_dir = File.join(@gem_assets_dir,"app","assets") 39 | 40 | if File.directory?(File.join(@pro_dir, "Developer")) 41 | @pro_dir = File.join(@pro_dir, "Developer") 42 | end 43 | unless File.directory?(@pro_dir) && File.directory?(File.join(@pro_dir, @ui_kit)) 44 | raise "Invalid Startup Framework directory" 45 | end 46 | 47 | #Copy the fonts folder to the fonts dir 48 | directory File.join(@pro_dir, @common_files,"fonts"), File.join(@gem_assets_dir, @fonts_dir) 49 | 50 | #Copy the icons folder to the images dir 51 | directory File.join(@pro_dir, @common_files,"icons"), File.join(@gem_assets_dir, @icons_dir) 52 | directory File.join(@pro_dir, @common_files,"img"), File.join(@gem_assets_dir, @img_dir) 53 | FileUtils.cp File.join(@pro_dir, @common_files,"css/images/bx_loader.gif"), File.join(@gem_assets_dir, "images") 54 | FileUtils.cp File.join(@pro_dir, @common_files,"css/images/controls.png"), File.join(@gem_assets_dir, "images") 55 | 56 | #Copy the js folder to the js dir 57 | directory File.join(@pro_dir, @common_files,"js"), File.join(@gem_assets_dir, @js_dir) 58 | 59 | #Copy the less folder to the less dir 60 | directory File.join(@pro_dir, @common_files,"less"), File.join(@gem_assets_dir, @less_dir) 61 | 62 | #Copy the ui-kit folder to the gems asset dir 63 | directory File.join(@pro_dir, @ui_kit), File.join(@gem_assets_dir, @target_ui_kit) 64 | 65 | #Copy demo assets 66 | directory File.join(@pro_dir,"samples"), File.join(@gem_assets_dir, "demo") 67 | 68 | #Copy the flat ui directory 69 | if options[:flatui] 70 | copy_flatui 71 | end 72 | 73 | #Remove all non LESS files from ui-kit folder 74 | 75 | Dir.glob("#{@gem_assets_dir}/#{@target_ui_kit}/**/*.*") do |file| 76 | unless file =~ /\.less\Z/ 77 | puts "Deleting file #{File.basename file}" 78 | FileUtils.rm file, force: true 79 | end 80 | end 81 | 82 | if options[:demo] 83 | copy_demo 84 | end 85 | 86 | 87 | end 88 | 89 | def add_assets 90 | copy_file "startup_framework.js", "app/assets/javascripts/startup_framework.js" 91 | copy_file "startup_framework.less", "app/assets/stylesheets/startup_framework.less" 92 | if options[:flatui] 93 | copy_file "flatui.js", "app/assets/javascripts/flatui.js" 94 | end 95 | 96 | # Handle JS Manifest 97 | js_manifest = "app/assets/javascripts/application.js" 98 | if File.exist?(js_manifest) 99 | content = File.read(js_manifest) 100 | unless content.match(/require\s+startup_framework/) 101 | insert_into_file js_manifest, "//= require startup_framework\n", :after => "twitter/bootstrap\n" 102 | if options[:flatui] 103 | insert_into_file js_manifest, "//= require flatui\n", :after => "twitter/bootstrap\n" 104 | end 105 | end 106 | unless content.match(/require\s+jquery.ui.all/) 107 | unless content.match(/require\s+jquery.ui.effect/) 108 | insert_into_file js_manifest, "//= require jquery.ui.effect\n", :after => "jquery\n" 109 | end 110 | unless content.match(/require\s+jquery.ui.tooltip/) 111 | insert_into_file js_manifest, "//= require jquery.ui.tooltip\n", :after => "jquery\n" 112 | end 113 | unless content.match(/require\s+jquery.ui.spinner/) 114 | insert_into_file js_manifest, "//= require jquery.ui.spinner\n", :after => "jquery\n" 115 | end 116 | unless content.match(/require\s+jquery.ui.slider/) 117 | insert_into_file js_manifest, "//= require jquery.ui.slider\n", :after => "jquery\n" 118 | end 119 | unless content.match(/require\s+jquery.ui.datepicker/) 120 | insert_into_file js_manifest, "//= require jquery.ui.datepicker\n", :after => "jquery\n" 121 | end 122 | unless content.match(/require\s+jquery.ui.button/) 123 | insert_into_file js_manifest, "//= require jquery.ui.button\n", :after => "jquery\n" 124 | end 125 | end 126 | else 127 | copy_file "application.js", js_manifest 128 | end 129 | 130 | # Handle CSS Manifest 131 | css_manifest = "app/assets/stylesheets/application.css" 132 | if File.exist?(css_manifest) 133 | content = File.read(css_manifest) 134 | unless content.match(/require_tree\s+\./) 135 | style_require_block = " *= require startup_framework\n" 136 | insert_into_file css_manifest, style_require_block, :after => "require_self\n" 137 | end 138 | else 139 | copy_file "application.css", "app/assets/stylesheets/application.css" 140 | end 141 | 142 | end 143 | 144 | def patch_assets 145 | @gem_assets_dir = File.expand_path("../../../../../app/assets/", __FILE__) 146 | 147 | #Replace fonts-path 148 | gsub_file File.join(@gem_assets_dir, @less_dir, "helper.less"), /\.\.\/fonts\//, "@{startup-basePath}common-files/fonts/" 149 | 150 | 151 | # replace all urls with asset urls with the exception of data urls 152 | Dir.glob("#{@gem_assets_dir}/#{@less_dir}/*.less") do |less_file| 153 | 154 | if less_file =~ /icon-font\.less\Z/ 155 | gsub_file less_file, /url\((.+?)\)/, 'font-url(\\1)' 156 | else 157 | gsub_file less_file, /url\((.+?)\)/, 'image-url(\\1)' 158 | end 159 | end 160 | 161 | Dir.glob("#{@gem_assets_dir}/#{@target_ui_kit}/**/*.less") do |ui_kit_less_file| 162 | #replace all files with the exception of price-common.less 163 | unless ui_kit_less_file =~ /price-common\.less\Z/ 164 | gsub_file ui_kit_less_file, /url\((.+?)\)/, 'image-url(\\1)' 165 | end 166 | end 167 | 168 | 169 | Dir.glob("#{@gem_assets_dir}/demo/**/*.html") do |html_file| 170 | # gsub_file html_file, /' 173 | # end 174 | 175 | gsub_file html_file, /src=\"img\//, "src=\"/assets/img/" 176 | gsub_file html_file, %r(src="../../), "src=\"/assets/startup-framework/" 177 | 178 | # Remove everything before tag and after 'Load JS', inclusive 179 | new_file = File.open("#{html_file}.erb", "w") 180 | puts "Creating ERB files" 181 | include_line = false 182 | IO.foreach(html_file) do |line| 183 | include_line = false if line =~ /Placed at the end/ 184 | 185 | new_file.write line if include_line 186 | 187 | include_line = true if line =~ // 188 | end 189 | new_file.close 190 | 191 | end 192 | 193 | Dir.glob("#{@gem_assets_dir}/demo/**/*.less") do |less_file| 194 | gsub_file less_file, %r(../../../), "/startup-framework/" 195 | 196 | insert_into_file less_file, "@import 'startup_framework';\n", :before => "/* header" 197 | 198 | f = File.new(less_file, 'r+') 199 | f.each_line do |line| 200 | if line.include? 'common-files' or line.include? 'flat-ui' 201 | # seek back to the beginning of the line. 202 | f.seek(-line.length, IO::SEEK_CUR) 203 | 204 | # overwrite line with spaces and add a newline char 205 | f.write(' ' * (line.length - 1)) 206 | f.write("\n") 207 | end 208 | end 209 | f.close 210 | 211 | end 212 | 213 | 214 | if options[:flatui] 215 | # switch.less 216 | # More involved patch because less-rails won't translate when inside ~"" 217 | # Create LESS variable and interpolate into .mask(~"") 218 | switch_file = File.join(@gem_assets_dir, "less/modules", "switch.less") 219 | mask_image_url = "@mask-image-url: image-url('switch/mask.png');\n" 220 | insert_into_file switch_file, mask_image_url, :before => ".has-switch {\n" 221 | gsub_file switch_file, /url\('\.\.\/images\/.+?\)/, "@{mask-image-url}" 222 | end 223 | # icon-font.less Do it for all less files in common-files/less and ui-kit folder 224 | #gsub_file File.join(@gem_assets_dir, @less_dir, "icon-font.less"), /url\((.+?)\)/, 'asset-url(\\1)' 225 | end 226 | 227 | 228 | private 229 | 230 | def copy_flatui 231 | puts "Copying flat ui files" 232 | directory File.join(@pro_dir, @flat_ui,"fonts"), File.join(@gem_assets_dir, "fonts") 233 | directory File.join(@pro_dir, @flat_ui,"images"), File.join(@gem_assets_dir, "images") 234 | directory File.join(@pro_dir, @flat_ui,"js"), File.join(@gem_assets_dir, "javascripts") 235 | directory File.join(@pro_dir, @flat_ui,"less"), File.join(@gem_assets_dir, "less") 236 | end 237 | 238 | def generate_demo 239 | 240 | end 241 | 242 | end 243 | end 244 | end -------------------------------------------------------------------------------- /lib/generators/startup_framework/install/templates/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the top of the 9 | * compiled file, but it's generally better to create a new file per style scope. 10 | * 11 | *= require_self 12 | *= require_tree . 13 | */ -------------------------------------------------------------------------------- /lib/generators/startup_framework/install/templates/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // the compiled file. 9 | // 10 | // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD 11 | // GO AFTER THE REQUIRES BELOW. 12 | // 13 | //= require jquery 14 | //= require jquery.ui.button 15 | //= require jquery.ui.datepicker 16 | //= require jquery.ui.slider.js 17 | //= require jquery.ui.spinner.js 18 | //= require jquery.ui.tooltip.js 19 | //= require jquery.ui.effect.js 20 | //= require jquery_ujs 21 | //= require twitter/bootstrap 22 | //= require flatuipro 23 | //= require_tree . -------------------------------------------------------------------------------- /lib/generators/startup_framework/install/templates/flatui.js: -------------------------------------------------------------------------------- 1 | //= require jquery.ui.touch-punch.min 2 | //= require bootstrap-select 3 | //= require bootstrap-switch 4 | //= require flatui-checkbox 5 | //= require flatui-radio 6 | //= require jquery.tagsinput 7 | //= require jquery.placeholder -------------------------------------------------------------------------------- /lib/generators/startup_framework/install/templates/startup_framework.js: -------------------------------------------------------------------------------- 1 | 2 | //= require startup-framework/common-files/js/modernizr.custom 3 | //= require startup-framework/common-files/js/page-transitions 4 | //= require startup-framework/common-files/js/jquery.scrollTo-1.4.3.1-min 5 | //= require startup-framework/common-files/js/jquery.parallax.min 6 | //= require startup-framework/common-files/js/easing.min 7 | //= require startup-framework/common-files/js/startup-kit 8 | //= require startup-framework/common-files/js/jquery.svg.js 9 | //= require startup-framework/common-files/js/jquery.svganim 10 | //= require startup-framework/common-files/js/jquery.backgroundvideo.min -------------------------------------------------------------------------------- /lib/generators/startup_framework/install/templates/startup_framework.less: -------------------------------------------------------------------------------- 1 | @startup-basePath: "startup-framework/"; 2 | @import 'variables.less'; 3 | @import 'mixins.less'; 4 | 5 | @import '@{startup-basePath}common-files/less/mixins.less'; 6 | @import '@{startup-basePath}common-files/less/common.less'; 7 | @import '@{startup-basePath}common-files/less/navbar.less'; 8 | @import '@{startup-basePath}common-files/less/helper.less'; 9 | @import '@{startup-basePath}common-files/less/icon-font.less'; -------------------------------------------------------------------------------- /test/install_generator_test.rb: -------------------------------------------------------------------------------- 1 | require File.join(File.dirname(__FILE__), 'test_helper') 2 | require 'generators/startup_framework/install/install_generator' 3 | 4 | class InstallGeneratorTest < Rails::Generators::TestCase 5 | destination File.expand_path("dummy", File.dirname(__FILE__)) 6 | setup :prepare_destination 7 | tests ::StartupFramework::Generators::InstallGenerator 8 | 9 | test "copy assets" do 10 | puts 'Halo World' 11 | run_generator %w(/Users/roney/Workspace/artifacts/StartupFramework) 12 | 13 | assert_file "app/cells/blog_cell.rb", /class BlogCell < Cell::Rails/ 14 | assert_file "app/cells/blog_cell.rb", /def post/ 15 | assert_file "app/cells/blog_cell.rb", /def latest/ 16 | assert_file "app/cells/blog/post.html.erb", %r(app/cells/blog/post.html.erb) 17 | assert_file "app/cells/blog/latest.html.erb", %r(app/cells/blog/latest.html.erb) 18 | assert_file "test/cells/blog_cell_test.rb" 19 | end 20 | end 21 | 22 | # Configure Rails Environment 23 | # ENV["RAILS_ENV"] = "test" 24 | # 25 | # require File.expand_path("../dummy/config/environment.rb", __FILE__) 26 | # require "rails/test_help" 27 | # 28 | # Rails.backtrace_cleaner.remove_silencers! 29 | # 30 | # # Load support files 31 | # Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } 32 | # 33 | # # Load fixtures from the engine 34 | # if ActiveSupport::TestCase.method_defined?(:fixture_path=) 35 | # ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__) 36 | # end 37 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | 2 | require File.expand_path("../dummy/config/environment.rb", __FILE__) 3 | require "rails/test_help" 4 | 5 | Rails.backtrace_cleaner.remove_silencers! 6 | 7 | # Load support files 8 | Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } 9 | 10 | # Load fixtures from the engine 11 | if ActiveSupport::TestCase.method_defined?(:fixture_path=) 12 | ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__) 13 | end 14 | --------------------------------------------------------------------------------