Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ruby in office time reboot

1,057 views

Published on

Talked at rubykaigi2017 on 20th Sep 2017

Published in: Engineering
  • Be the first to comment

Ruby in office time reboot

  1. 1. Ruby in office time reboot 後藤 謙太郎, Goto Kentaro @gotoken syngram.co.jp
  2. 2. Acknowledgements • All you RubyKaigi participants • All RubyKaigi staffs • All RubyKaigi sponsors • All Ruby committers • Matz • And all my colleagues at work in Syngram
  3. 3. Apologies • Too late preparation for this presentation • English interpreter has not been given enough time • The responsibility lies with the presenter, that is me
  4. 4. Excuse • Non edge technologies only • Please move to the next room if you’d like to get high-tech talk • Maybe old topics
  5. 5. Agenda
  6. 6. Today’s topics • Introducing this series • Case studies • Summary
  7. 7. Introducing this series
  8. 8. Scope of this session • Engineers having several roles in small company or team • Cases of useful Ruby and products • Commoditized techs, not edge
  9. 9. Past talks • 2006 manage job with Kagemai BTS, share with Hiki, RWiki • 2007 One liner helps us • 2008 customize BTS view, scraping and feeding intra site
  10. 10. Past slides available • https://www.slideshare.net/gotoken
  11. 11. Introducing our team • Products • Good look and much usable web GUIs and sites • Effective company communication. Printing matters and SI • Professional GUI prototyping for data scientists
  12. 12. Our team • Members • Designers: use Adobe CC and prototyping tools InVision etc. • Front-end engineers: Markup, Stylesheet and JavaScript • Back-end engineers: Programming, networking and all tech matters • No proper sales person
  13. 13. Principle: Merit of a team • Diversity • I can’t create beautiful looks • But our team provide them • Redundancy • I can’t do all administration • But our team achieve them
  14. 14. Pleasures • Working with designers is fun. • They have flexible thinking ways • Creating process is interesting • I can be a coauthor of beautiful products • Kaizen (Improvements) • A little bit of programming sometimes makes work much efficient • Small tools are often helpful
  15. 15. Small team difficulties • IT solutions often needs admin’s help • We are small team • Engineers cannot be dedicated to proper intranet matters
  16. 16. Case studies
  17. 17. Case 1: Redmine applied to everything
  18. 18. Redmine • Helped me very much. Thank you developers! • In this 10 years Redmine has been much sophisticated • Non-engineer uses are also comfortable
  19. 19. Basic concepts of issue tracker Project VersionVersionVersionVersion Issue Issue IssueIssue Issue Roadmap
  20. 20. Issue, Roadmap, Project • Issue • Will be closed eventually • Roadmap • A sub-goal of project in many cases • Collection of ticket is also useful. e.g., defining a business period • Project • Defines development of a project • Never ending project fits to business operation.
  21. 21. Projects, ending and never ending • Projects with goal • Usual projects have the end, will be closed anyway • Projects without goal • Collections of issues which have similar scope and lifecycle • Good alternative of Excel sheet and folder forest
  22. 22. Succeeding endless project example • Name: Borrowed • Purpose: Track lifecycle of borrowed items and its IOU • Attach photos of all items and all steps of package opening • We can package correctly again • Periodical not-lost checking is easy • Cross project reference is easy too
  23. 23. Succeeding endless project example • Name: Inquiries • Purpose: Track biz flow as an issue from offering to billing • Each version stands for ship-out month • Versions are closed annually • Orders can be listed by month
  24. 24. Deploying Redmine lxc Ansible Playbook Private fork customized On-premise Repository On-premise origin repo provisioning Thanks to Hiraku Kuroda, Syngram system administrator The service
  25. 25. Useful plugin pick up • Attach image from clipboard http://www.redmine.org/plugins/clipboard_image_paste • Author: Richard Pecl • Enables attach image by paste and crop image • Screen shot of bugs helps understanding immediately the problem • Paste images also from power point figures or excel rectangle region
  26. 26. Case 2: Every member has own projects
  27. 27. Problem All servers are on local site, not cloud projects repos Update ticket by cron Web designers Many members cannot create repo
  28. 28. Problem: Repositories and Redmine • Creating SVN repository needs admin operation `svnadmin create reponame` • Creating Git shared repositories needs complex operations from command line • We want every team member to be able to prepare Redmine project.
  29. 29. Before GitLab • We have used large one subversion repository • Each our product was a sub-directory in the repo • Team members can add sub-directory via TortoiseSVN • But that has many problems • Commit often affects topology widely. Merging is almost impossible • Too large repo: backup copy or exporting repository is hell • Importing to Redmine took very long time and time-outed
  30. 30. Deploying GitLab lxc On-premise install package Ansible Playbook provisioning Thanks to Hiraku again The service
  31. 31. Problem (repeated) projects repos Update ticket by cron Web designers Many members cannot create repo All servers are on local site, not cloud
  32. 32. Every member can setup a project. Role in each projects is variable Redmine and GitLab CE gives us projects repos Update ticket by git push Web designers Every member can setup a repository All servers are on local site, not cloud
  33. 33. Redmine and GitLab CE gives us • Every team member can create new repository • Commit or push updates ticket via github hook plugin: https://github.com/koppen/redmine_github_hook • Git cultures: issue branch, easy merge • Web hooks also available: e.g. Slack • These all features can be configured on web interface • No .git/hooks scripts needed
  34. 34. • Redmine requires git bare repository on local filesystem • We want separate GitLab lxc and Redmine lxc • Solution: bind mount - exposing host directory to containers Referring GitLab from Redmine On-premise lxcreposlxc bind mount bind mount Thanks to Hiraku again readable
  35. 35. Case 3: Customers like xlsx Axlsx: Office Open XML Spreadsheet Generation
  36. 36. Situation • Renewal a static web site. hundreds pages. • Analyze them to obtain link structure, template variations… • Then you got a table like this No. Path Title Tmpl Depth Lv2 Lv2 Lv4 Lv5 1 index.html The Ruby Corporaton top.dwt 1 2 about/index.html Corporation overview common.dwt 2 About us 3 about/mission.html Our missions common.dwt 3 About us 4 about/ir.html Investor Relations common.dwt 3 Abuut us 5 about/history.html Corporation history common.dwt 3 About us 6 about/access.html Access common.dwt 2 7 about/privacy.html Privacy Policy common.dwt 2 8 product/index.html Product product.dwt 2 Product
  37. 37. When you send this table to your client • If you want add column value filter, column value sorter • You may choose MS Excel • Save as a CSV or TSV, read with Excel, Edit and then save as xlsx • You may also make it more pretty, e.g., coloring, font text styling, appending summary sheet • But if the source data will be updated many times • For example, data was incomplete at first • Another case, you have to add a column for progress of the process • Updating manually is boredom and hard to avoid mistakes
  38. 38. Axls is xlsx document generator • Chart generation • Styling • Auto and Manually data type • Image attachment • Hyperlinks • Auto filtering • Printing related features: header, footer, page break
  39. 39. Case 4: I want provide a script to designer
  40. 40. Well-known one line http server ruby -run -e httpd • Serves current directory on http://localhost:8080 • It is too simple to provide something more than file browser • However there are some command line options • Try ruby -run -e httpd -- --help
  41. 41. httpd options % ruby -run -e httpd -- --help Run WEBrick HTTP server. ruby -run -e httpd -- [OPTION] DocumentRoot --bind-address=ADDR address to bind --port=NUM listening port number --max-clients=MAX max number of simultaneous clients --temp-dir=DIR temporary directory --do-not-reverse-lookup disable reverse lookup --request-timeout=SECOND request timeout in seconds --http-version=VERSION HTTP version -v verbose
  42. 42. To provide something more complex • Typically, file processing script on a server • For example, web site checking with eyes repository Working copy Screenshot viewer.html update git pull node shot.js Want to provide a CGI kicking here <img src>
  43. 43. Sinatra is fit to such simple task
  44. 44. Considerations
  45. 45. Summary • Applying Redmine to everything • Admin-free project setup with Redmine + GitLab • Axlsx helps communication with client • Sinatra is good simple DSL
  46. 46. By the way, what is fun of Ruby? Recently, I feel • Closing thinking and writing • e.g., right substitution • Simple closure syntax • But why we don’t use JavaScript promise-like interface?
  47. 47. Thank you!

×